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.
7 8 9 |
# File 'lib/homura_vendor_tilt.rb', line 7 def initialize @cache = {} end |
Instance Method Details
#clear ⇒ Object
15 16 17 |
# File 'lib/homura_vendor_tilt.rb', line 15 def clear @cache.clear end |
#fetch(*key) ⇒ Object
11 12 13 |
# File 'lib/homura_vendor_tilt.rb', line 11 def fetch(*key) @cache[key] ||= yield end |