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.



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

def initialize
  @cache = {}
end

Instance Method Details

#clearObject



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