Class: RedisConnection
- Inherits:
-
Object
- Object
- RedisConnection
- Defined in:
- lib/redis_store.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#redis ⇒ Object
readonly
Returns the value of attribute redis.
Instance Method Summary collapse
-
#counters ⇒ Object
end initialize.
-
#initialize(*args) ⇒ RedisConnection
constructor
A new instance of RedisConnection.
Constructor Details
#initialize(*args) ⇒ RedisConnection
Returns a new instance of RedisConnection.
12 13 14 15 16 17 |
# File 'lib/redis_store.rb', line 12 def initialize *args #@key= key $redis ||= Redis.new(:path => "/tmp/redis.sock",:driver => :hiredis) @redis = $redis # puts "Connected to Redis" end |
Instance Attribute Details
#redis ⇒ Object (readonly)
Returns the value of attribute redis.
11 12 13 |
# File 'lib/redis_store.rb', line 11 def redis @redis end |
Instance Method Details
#counters ⇒ Object
end initialize
19 20 21 |
# File 'lib/redis_store.rb', line 19 def counters @redis.hgetall "counters" end |