Class: WurflCloud::Cache::LocalMemory
- Inherits:
-
Object
- Object
- WurflCloud::Cache::LocalMemory
- Defined in:
- lib/wurfl_cloud/cache/local_memory.rb
Instance Attribute Summary collapse
-
#mtime ⇒ Object
Returns the value of attribute mtime.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Should return the value stored for the key, nil if the key is not in cache The LocalMemory cache stores the values in the local hash.
-
#[]=(key, value) ⇒ Object
reads the value from the local hash.
-
#initialize(options = nil, environment = nil) ⇒ LocalMemory
constructor
A new instance of LocalMemory.
-
#validate(current_mtime) ⇒ Object
Validates the cache it’s a no-op in the local memory cache.
Constructor Details
#initialize(options = nil, environment = nil) ⇒ LocalMemory
Returns a new instance of LocalMemory.
16 17 18 |
# File 'lib/wurfl_cloud/cache/local_memory.rb', line 16 def initialize(=nil, environment=nil) @cache = {} end |
Instance Attribute Details
#mtime ⇒ Object
Returns the value of attribute mtime.
20 21 22 |
# File 'lib/wurfl_cloud/cache/local_memory.rb', line 20 def mtime @mtime end |
Instance Method Details
#[](key) ⇒ Object
Should return the value stored for the key, nil if the key is not in cache The LocalMemory cache stores the values in the local hash
33 34 35 |
# File 'lib/wurfl_cloud/cache/local_memory.rb', line 33 def [](key) @cache[key] end |
#[]=(key, value) ⇒ Object
reads the value from the local hash
38 39 40 |
# File 'lib/wurfl_cloud/cache/local_memory.rb', line 38 def []=(key, value) @cache[key] = value end |
#validate(current_mtime) ⇒ Object
Validates the cache it’s a no-op in the local memory cache
28 29 |
# File 'lib/wurfl_cloud/cache/local_memory.rb', line 28 def validate(current_mtime) end |