Class: Ruboty::Brains::Redis
- Inherits:
-
Base
- Object
- Base
- Ruboty::Brains::Redis
- Defined in:
- lib/ruboty/brains/redis.rb
Constant Summary collapse
- NAMESPACE =
"ruboty"
- KEY =
"brain"
Instance Attribute Summary collapse
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize ⇒ Redis
constructor
A new instance of Redis.
Constructor Details
#initialize ⇒ Redis
Returns a new instance of Redis.
16 17 18 19 20 |
# File 'lib/ruboty/brains/redis.rb', line 16 def initialize super @thread = Thread.new { sync } @thread.abort_on_exception = true end |
Instance Attribute Details
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
11 12 13 |
# File 'lib/ruboty/brains/redis.rb', line 11 def thread @thread end |
Instance Method Details
#data ⇒ Object
22 23 24 |
# File 'lib/ruboty/brains/redis.rb', line 22 def data @data ||= pull || {} end |