Class: Undo::Storage::Redis

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

Defined Under Namespace

Modules: Gemspec

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Redis.



6
7
8
# File 'lib/undo/storage/redis.rb', line 6

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

Instance Method Details

#fetch(uuid) ⇒ Object



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

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

#put(uuid, object) ⇒ Object



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

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