Class: Novel::RepositoryAdapters::Memory
- Inherits:
-
Object
- Object
- Novel::RepositoryAdapters::Memory
- Defined in:
- lib/novel/repository_adapters/memory.rb
Instance Method Summary collapse
- #find_context(saga_id) ⇒ Object
-
#initialize ⇒ Memory
constructor
A new instance of Memory.
- #persist_context(saga_id, context) ⇒ Object
Constructor Details
#initialize ⇒ Memory
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 |