Class: RedisConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/redis_connection.rb

Overview

Initialize a connection to Redis. Currently the path to redis socket is hardcoded (/tmp/redis.sock), as well as the driver (:hiredis). global variable $redis gets set.

Direct Known Subclasses

TimeSeries

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ RedisConnection

Returns a new instance of RedisConnection.



15
16
17
18
19
20
# File 'lib/redis_connection.rb', line 15

def initialize *args
  #@key= key
  $redis ||= Redis.new(:path => "/tmp/redis.sock",:driver => :hiredis)
  @redis = $redis
  #puts green "Connected to Redis"
end

Instance Attribute Details

#redisObject (readonly)

Returns the value of attribute redis.



14
15
16
# File 'lib/redis_connection.rb', line 14

def redis
  @redis
end