In Files

Parent

Methods

Tilt::Cache

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.

Public Class Methods

new() click to toggle source
# File lib/tilt.rb, line 122
def initialize
  @cache = {}
end

Public Instance Methods

clear() click to toggle source
# File lib/tilt.rb, line 130
def clear
  @cache = {}
end
fetch(*key) click to toggle source
# File lib/tilt.rb, line 126
def fetch(*key)
  @cache[key] ||= yield
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.