Class: Whirl::Redis

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/whirl/redis.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRedis

Returns a new instance of Redis.



12
13
14
15
16
17
18
19
# File 'lib/whirl/redis.rb', line 12

def initialize
  self.client = if redis_url = ENV['REDISTOGO_URL']
    u = URI.parse(redis_url)
    ::Redis.new host: u.host, port: u.port, password: u.password
  else
    ::Redis.new
  end
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



10
11
12
# File 'lib/whirl/redis.rb', line 10

def client
  @client
end