Class: Rack::Idempotency::MemoryStore
- Inherits:
-
Object
- Object
- Rack::Idempotency::MemoryStore
- Defined in:
- lib/rack/idempotency/memory_store.rb
Overview
Stores idempotency information in a Hash.
Instance Method Summary collapse
-
#initialize ⇒ MemoryStore
constructor
A new instance of MemoryStore.
- #read(id) ⇒ Object
- #write(id, value) ⇒ Object
Constructor Details
#initialize ⇒ MemoryStore
Returns a new instance of MemoryStore.
5 6 7 |
# File 'lib/rack/idempotency/memory_store.rb', line 5 def initialize @store = {} end |
Instance Method Details
#read(id) ⇒ Object
9 10 11 |
# File 'lib/rack/idempotency/memory_store.rb', line 9 def read(id) store[id] end |
#write(id, value) ⇒ Object
13 14 15 |
# File 'lib/rack/idempotency/memory_store.rb', line 13 def write(id, value) store[id] = value end |