Class: RServiceBus::StateStorage_InMemory

Inherits:
Object
  • Object
show all
Defined in:
lib/rservicebus/StateStorage/InMemory.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ StateStorage_InMemory

Returns a new instance of StateStorage_InMemory.



5
6
7
# File 'lib/rservicebus/StateStorage/InMemory.rb', line 5

def initialize( uri )
    @hash = Hash.new
end

Instance Method Details

#BeginObject

Start



10
11
12
# File 'lib/rservicebus/StateStorage/InMemory.rb', line 10

def Begin
    @list = Array.new
end

#CommitObject

Finish



23
24
25
26
27
# File 'lib/rservicebus/StateStorage/InMemory.rb', line 23

def Commit
    @list.each do |e|
        @hash[ e['name'] ] = e['hash']
    end
end

#Get(handler) ⇒ Object

Get



15
16
17
18
19
20
# File 'lib/rservicebus/StateStorage/InMemory.rb', line 15

def Get( handler )
    hash = @hash[handler.class.name]
    @list << Hash['name', handler.class.name, 'hash', hash]

    return hash
end