Class: Ellen::Brains::Redis

Inherits:
Base
  • Object
show all
Defined in:
lib/ellen/brains/redis.rb

Constant Summary collapse

NAMESPACE =
"ellen"
KEY =
"brain"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRedis

Returns a new instance of Redis.



17
18
19
20
# File 'lib/ellen/brains/redis.rb', line 17

def initialize
  super
  @thread = Thread.new { sync }
end

Instance Attribute Details

#threadObject (readonly)

Returns the value of attribute thread.



12
13
14
# File 'lib/ellen/brains/redis.rb', line 12

def thread
  @thread
end

Instance Method Details

#dataObject



22
23
24
# File 'lib/ellen/brains/redis.rb', line 22

def data
  @data ||= pull || {}
end

#saveObject



26
27
28
# File 'lib/ellen/brains/redis.rb', line 26

def save
  push
end