Class: Whirl::Redis
- Inherits:
-
Object
- Object
- Whirl::Redis
- Extended by:
- Forwardable
- Defined in:
- lib/whirl/redis.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize ⇒ Redis
constructor
A new instance of Redis.
Constructor Details
#initialize ⇒ Redis
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
#client ⇒ Object
Returns the value of attribute client.
10 11 12 |
# File 'lib/whirl/redis.rb', line 10 def client @client end |