Class: Undo::Storage::Redis

Inherits:
Object
  • Object
show all
Defined in:
lib/undo/storage/redis.rb

Constant Summary collapse

VERSION =
"0.0.3"

Instance Method Summary collapse

Constructor Details

#initialize(redis, options = {}) ⇒ Redis

Returns a new instance of Redis.



8
9
10
# File 'lib/undo/storage/redis.rb', line 8

def initialize(redis, options = {})
  @redis = redis
end

Instance Method Details

#fetch(uuid) ⇒ Object



16
17
18
# File 'lib/undo/storage/redis.rb', line 16

def fetch(uuid)
  deserialize redis.get(uuid)
end

#put(uuid, object) ⇒ Object



12
13
14
# File 'lib/undo/storage/redis.rb', line 12

def put(uuid, object)
  redis.set uuid, serialize(object)
end