Class: TelegramOnSteroids::RedisStore
- Inherits:
-
Object
- Object
- TelegramOnSteroids::RedisStore
- Defined in:
- lib/telegram_on_steroids/redis_store.rb
Instance Method Summary collapse
-
#initialize ⇒ RedisStore
constructor
A new instance of RedisStore.
- #read(key) ⇒ Object
- #write(key, value) ⇒ Object
Constructor Details
#initialize ⇒ RedisStore
Returns a new instance of RedisStore.
2 3 4 |
# File 'lib/telegram_on_steroids/redis_store.rb', line 2 def initialize @client = Redis.new(url: ENV['REDIS_URL']) end |
Instance Method Details
#read(key) ⇒ Object
6 7 8 |
# File 'lib/telegram_on_steroids/redis_store.rb', line 6 def read(key) @client.get(key) end |
#write(key, value) ⇒ Object
10 11 12 |
# File 'lib/telegram_on_steroids/redis_store.rb', line 10 def write(key, value) @client.set(key, value) end |