Class: Tilt::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/homura_vendor_tilt.rb

Instance Method Summary collapse

Constructor Details

#initializeCache

Returns a new instance of Cache.



8
9
10
# File 'lib/homura_vendor_tilt.rb', line 8

def initialize
  @cache = {}
end

Instance Method Details

#clearObject



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