Module: Angelo::Templates::TemplateCaching

Defined in:
lib/angelo/templates.rb

Defined Under Namespace

Classes: Cache

Constant Summary collapse

@@template_cache =

Create a template cache that all subclasses of Angelo::Base will share. And a non_cache object that will stand in for the cache when reloading templates, which is set per-class.

Cache.new
@@non_cache =
Object.new.tap do |o|
  def o.fetch(*args)
    yield
  end
end

Instance Method Summary collapse

Instance Method Details

#get_template(*args) ⇒ Object



112
113
114
115
116
# File 'lib/angelo/templates.rb', line 112

def get_template(*args)
  template_cache.fetch(*args) do
    instantiate_template(*args)
  end
end