Class: ButterCMS::DataStoreAdapters::Redis
- Inherits:
-
Object
- Object
- ButterCMS::DataStoreAdapters::Redis
- Defined in:
- lib/buttercms/data_store_adapters/redis.rb
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize(options) ⇒ Redis
constructor
A new instance of Redis.
- #set(key, value) ⇒ Object
Constructor Details
#initialize(options) ⇒ Redis
Returns a new instance of Redis.
11 12 13 14 15 |
# File 'lib/buttercms/data_store_adapters/redis.rb', line 11 def initialize() redis_url = .first @redis = ::Redis.new(url: redis_url) end |
Instance Method Details
#get(key) ⇒ Object
21 22 23 |
# File 'lib/buttercms/data_store_adapters/redis.rb', line 21 def get(key) @redis.get(key) end |
#set(key, value) ⇒ Object
17 18 19 |
# File 'lib/buttercms/data_store_adapters/redis.rb', line 17 def set(key, value) @redis.set(key, value) end |