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 122
122:     def initialize
123:       @cache = {}
124:     end

Public Instance methods

[Source]

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

[Source]

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

[Validate]