Class: Nestene::MemoryStorage
- Inherits:
-
Object
- Object
- Nestene::MemoryStorage
- Defined in:
- lib/nestene/storage.rb
Instance Method Summary collapse
-
#initialize ⇒ MemoryStorage
constructor
A new instance of MemoryStorage.
- #list ⇒ Object
- #load(key) ⇒ Object
- #store(key, value) ⇒ Object
Constructor Details
#initialize ⇒ MemoryStorage
Returns a new instance of MemoryStorage.
55 56 57 |
# File 'lib/nestene/storage.rb', line 55 def initialize @storage = {} end |
Instance Method Details
#list ⇒ Object
59 60 61 |
# File 'lib/nestene/storage.rb', line 59 def list @storage.keys end |
#load(key) ⇒ Object
63 64 65 |
# File 'lib/nestene/storage.rb', line 63 def load(key) @storage[key] end |
#store(key, value) ⇒ Object
67 68 69 |
# File 'lib/nestene/storage.rb', line 67 def store(key, value) @storage[key] = value end |