13 lines
203 B
Ruby
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
|