Class: Undo::Storage::Redis

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

Constant Summary collapse

VERSION =
"0.0.4"

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Redis.



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

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

Instance Method Details

#fetch(uuid) ⇒ Object



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

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

#put(uuid, object) ⇒ Object



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

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