Class: Rbdux::Stores::ImmutableMemoryStore
- Inherits:
-
Object
- Object
- Rbdux::Stores::ImmutableMemoryStore
- Defined in:
- lib/rbdux/stores/immutable_memory_store.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.with_state(state) ⇒ Object
6 7 8 |
# File 'lib/rbdux/stores/immutable_memory_store.rb', line 6 def self.with_state(state) ImmutableMemoryStore.new(state) end |
Instance Method Details
#get(key) ⇒ Object
10 11 12 |
# File 'lib/rbdux/stores/immutable_memory_store.rb', line 10 def get(key) state[key] end |
#get_all ⇒ Object
14 15 16 |
# File 'lib/rbdux/stores/immutable_memory_store.rb', line 14 def get_all state.to_h end |
#replace(state) ⇒ Object
22 23 24 |
# File 'lib/rbdux/stores/immutable_memory_store.rb', line 22 def replace(state) @state = Hamster::Hash.new(state) end |
#set(key, value) ⇒ Object
18 19 20 |
# File 'lib/rbdux/stores/immutable_memory_store.rb', line 18 def set(key, value) @state = state.put(key, value) end |