Class: LogMagic::PersistanceLayer
- Inherits:
-
Object
- Object
- LogMagic::PersistanceLayer
- Defined in:
- lib/log_magic/persistance_layer.rb
Instance Attribute Summary collapse
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #add_value(key, value) ⇒ Object
-
#initialize ⇒ PersistanceLayer
constructor
A new instance of PersistanceLayer.
- #retrieve_value(uuid, key) ⇒ Object
Constructor Details
#initialize ⇒ PersistanceLayer
Returns a new instance of PersistanceLayer.
7 8 9 10 |
# File 'lib/log_magic/persistance_layer.rb', line 7 def initialize @redis = Redis.new @uuid = ::SecureRandom.uuid end |
Instance Attribute Details
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
5 6 7 |
# File 'lib/log_magic/persistance_layer.rb', line 5 def uuid @uuid end |
Instance Method Details
#add_value(key, value) ⇒ Object
12 13 14 |
# File 'lib/log_magic/persistance_layer.rb', line 12 def add_value(key, value) @redis.hset(uuid, key, value) end |
#retrieve_value(uuid, key) ⇒ Object
16 17 18 |
# File 'lib/log_magic/persistance_layer.rb', line 16 def retrieve_value(uuid, key) @redis.hget(uuid, key) end |