Class: RServiceBus2::StateStorageInMemory
- Inherits:
-
Object
- Object
- RServiceBus2::StateStorageInMemory
- Defined in:
- lib/rservicebus2/state_storage/inmemory.rb
Overview
StateStorage InMemory
Instance Method Summary collapse
- #begin ⇒ Object
- #commit ⇒ Object
- #get(handler) ⇒ Object
-
#initialize(_uri) ⇒ StateStorageInMemory
constructor
A new instance of StateStorageInMemory.
Constructor Details
#initialize(_uri) ⇒ StateStorageInMemory
Returns a new instance of StateStorageInMemory.
4 5 6 |
# File 'lib/rservicebus2/state_storage/inmemory.rb', line 4 def initialize(_uri) @hash = {} end |
Instance Method Details
#begin ⇒ Object
8 9 10 |
# File 'lib/rservicebus2/state_storage/inmemory.rb', line 8 def begin @list = [] end |
#commit ⇒ Object
19 20 21 22 23 |
# File 'lib/rservicebus2/state_storage/inmemory.rb', line 19 def commit @list.each do |e| @hash[e['name']] = e['hash'] end end |
#get(handler) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/rservicebus2/state_storage/inmemory.rb', line 12 def get(handler) hash = @hash[handler.class.name] @list << Hash['name', handler.class.name, 'hash', hash] hash end |