Class: ButterCMS::DataStoreAdapters::Redis

Inherits:
Object
  • Object
show all
Defined in:
lib/buttercms/data_store_adapters/redis.rb

Instance Method Summary collapse

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(options)
  redis_url = options.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