Class: Rack::Idempotency::MemoryStore

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/idempotency/memory_store.rb

Overview

Stores idempotency information in a Hash.

Instance Method Summary collapse

Constructor Details

#initializeMemoryStore

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