Class: Tilt::Cache
- Inherits:
-
Object
- Object
- Tilt::Cache
- Defined in:
- lib/homura_vendor_tilt.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #fetch(*key) ⇒ Object
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
8 9 10 |
# File 'lib/homura_vendor_tilt.rb', line 8 def initialize @cache = {} end |
Instance Method Details
#clear ⇒ Object
16 17 18 |
# File 'lib/homura_vendor_tilt.rb', line 16 def clear @cache.clear end |
#fetch(*key) ⇒ Object
12 13 14 |
# File 'lib/homura_vendor_tilt.rb', line 12 def fetch(*key) @cache[key] ||= yield end |