Class: Undo::Storage::Redis
- Inherits:
-
Object
- Object
- Undo::Storage::Redis
- Defined in:
- lib/undo/storage/redis.rb
Constant Summary collapse
- VERSION =
"0.0.3"
Instance Method Summary collapse
- #fetch(uuid) ⇒ Object
-
#initialize(redis, options = {}) ⇒ Redis
constructor
A new instance of Redis.
- #put(uuid, object) ⇒ Object
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, = {}) @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 |