Class: Novel::RepositoryAdapters::Memory

Inherits:
Object
  • Object
show all
Defined in:
lib/novel/repository_adapters/memory.rb

Instance Method Summary collapse

Constructor Details

#initializeMemory

Returns a new instance of Memory.



4
5
6
# File 'lib/novel/repository_adapters/memory.rb', line 4

def initialize
  @store = {}
end

Instance Method Details

#find_context(saga_id) ⇒ Object



8
9
10
# File 'lib/novel/repository_adapters/memory.rb', line 8

def find_context(saga_id)
  @store[saga_id]
end

#persist_context(saga_id, context) ⇒ Object



12
13
14
15
# File 'lib/novel/repository_adapters/memory.rb', line 12

def persist_context(saga_id, context)
  @store[saga_id] = context
  context
end