Class Amrita::SourceCache
In: lib/amrita/template.rb
Parent: Object

Methods

get_item   new   save_item  

Included Modules

CacheManager

Public Class methods

[Source]

# File lib/amrita/template.rb, line 305
    def initialize(dir)
      @dir = dir
      @module_cache = ModuleCache.new
    end

Public Instance methods

[Source]

# File lib/amrita/template.rb, line 310
    def get_item(typ, filename, key)
      case typ
      when :module
        @module_cache.get_item(typ, filename, key)
      when :source
        load_source(filename, key)
      else
        raise "can't happen wrong type #{typ}"
      end
    end

[Source]

# File lib/amrita/template.rb, line 321
    def save_item(item)
      case item.type
      when :module
        @module_cache.save_item(item)
      when :source
        save_source(item)
      else
        raise "can't happen"
      end
    end

[Validate]