Class: Amrita::SourceCache

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

Methods

get_item new save_item

Included modules

CacheManager

Public Class methods

new(dir)

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

Public Instance methods

get_item(typ, filename, key)

    # 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

save_item(item)

    # 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