1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/lib/middleman/cache.rb
2011-11-19 18:53:18 -08:00

23 lines
No EOL
305 B
Ruby

module Middleman
class Cache
def initialize
@cache = {}
end
def fetch(*key)
@cache[key] ||= yield
end
def clear
@cache = {}
end
def set(key, value)
@cache[key] = value
end
def remove(*key)
@cache.delete(key)
end
end
end