Class Tilt::Cache
In: lib/tilt.rb
Parent: Object

Extremely simple template cache implementation. Calling applications create a Tilt::Cache instance and use fetch with any set of hashable arguments (such as those to Tilt.new):

  cache = Tilt::Cache.new
  cache.fetch(path, line, options) { Tilt.new(path, line, options) }

Subsequent invocations return the already loaded template object.

Methods

clear   fetch   new  

Public Class methods

[Source]

     # File lib/tilt.rb, line 124
124:     def initialize
125:       @cache = {}
126:     end

Public Instance methods

[Source]

     # File lib/tilt.rb, line 132
132:     def clear
133:       @cache = {}
134:     end

[Source]

     # File lib/tilt.rb, line 128
128:     def fetch(*key)
129:       @cache[key] ||= yield
130:     end

[Validate]