class Sinatra::Helpers::Stream::TemplateCache
Extremely simple template cache implementation.
* Not thread-safe. * Size is unbounded. * Keys are not copied defensively, and should not be modified after being passed to #fetch. More specifically, the values returned by key#hash and key#eql? should not change.
Implementation copied from Tilt::Cache.
Public Class Methods
Public Instance Methods
Source
# File lib/sinatra/base.rb 951 def fetch(*key) 952 @cache.fetch(key) do 953 @cache[key] = yield 954 end 955 end
Caches a value for key, or returns the previously cached value. If a value has been previously cached for key then it is returned. Otherwise, block is yielded to and its return value which may be nil, is cached under key and returned.