compass/doc-src/lib/data_sources/nanoc_monkey_patches.rb
2010-02-07 09:14:20 -08:00

13 lines
168 B
Ruby

class Nanoc3::Site
def cached(key)
if cache.has_key?(key)
cache[key]
else
cache[key]= yield
end
end
def cache
@cache ||= {}
end
end