compass/doc-src/lib/data_sources/nanoc_monkey_patches.rb
2010-11-12 21:45:24 -08:00

13 lines
203 B
Ruby

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