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.
56 57 58 |
# File 'lib/nestene/storage.rb', line 56 def initialize @storage = {} end |
Instance Method Details
#list ⇒ Object
60 61 62 |
# File 'lib/nestene/storage.rb', line 60 def list @storage.keys end |
#load(key) ⇒ Object
64 65 66 |
# File 'lib/nestene/storage.rb', line 64 def load(key) @storage[key] end |
#store(key, value) ⇒ Object
68 69 70 |
# File 'lib/nestene/storage.rb', line 68 def store(key, value) @storage[key] = value end |