Class: Kiyohime::Stores::RedisStore
- Inherits:
-
Object
- Object
- Kiyohime::Stores::RedisStore
- Defined in:
- lib/kiyohime/stores/redis_store.rb
Overview
A rudimentary abstraction of the store which will advance over time no doubt
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #hiredis ⇒ Object
-
#initialize(uri = nil) ⇒ RedisStore
constructor
A new instance of RedisStore.
- #redis ⇒ Object
Constructor Details
#initialize(uri = nil) ⇒ RedisStore
Returns a new instance of RedisStore.
10 11 12 |
# File 'lib/kiyohime/stores/redis_store.rb', line 10 def initialize(uri = nil) @url = uri || ENV['REDIS_URL'] || ENV['REDISCLOUD_URL'] || 'redis://127.0.0.1:6379/0' end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/kiyohime/stores/redis_store.rb', line 8 def url @url end |
Instance Method Details
#hiredis ⇒ Object
18 19 20 |
# File 'lib/kiyohime/stores/redis_store.rb', line 18 def hiredis EM::Hiredis.connect(url).pubsub end |
#redis ⇒ Object
14 15 16 |
# File 'lib/kiyohime/stores/redis_store.rb', line 14 def redis Redis.new(url: url) end |