Class: Undo::Storage::Redis
- Inherits:
-
Object
- Object
- Undo::Storage::Redis
- Defined in:
- lib/undo/storage/redis.rb
Constant Summary collapse
- VERSION =
"0.0.4"
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 11 |
# File 'lib/undo/storage/redis.rb', line 8 def initialize(redis, = {}) @redis = redis = 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, 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), end |