Class: Rhinestone::InMemoryCacheBackend
- Inherits:
-
Object
- Object
- Rhinestone::InMemoryCacheBackend
- Defined in:
- lib/rhinestone/in_memory_cache_backend.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize ⇒ InMemoryCacheBackend
constructor
A new instance of InMemoryCacheBackend.
- #set(key, value) ⇒ Object
Constructor Details
#initialize ⇒ InMemoryCacheBackend
Returns a new instance of InMemoryCacheBackend.
5 6 7 |
# File 'lib/rhinestone/in_memory_cache_backend.rb', line 5 def initialize @data = {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/rhinestone/in_memory_cache_backend.rb', line 3 def data @data end |
Instance Method Details
#get(key) ⇒ Object
13 14 15 |
# File 'lib/rhinestone/in_memory_cache_backend.rb', line 13 def get(key) data[key] end |
#set(key, value) ⇒ Object
9 10 11 |
# File 'lib/rhinestone/in_memory_cache_backend.rb', line 9 def set(key, value) data[key] = value end |