lib/cache/redis.rb in sensei_eod_utils-0.0.38 vs lib/cache/redis.rb in sensei_eod_utils-0.0.39
- old
+ new
@@ -1,25 +1,23 @@
# frozen_string_literal: true
require 'redis'
module Cache
- class Redis
+ class RedisCache
class << self
def set(key, value, expiry = 3600)
- raise "Test"
- redis.set(key, value, ex: expiry)
+ cache.set(key, value, ex: expiry)
end
def get(key)
- raise redis.get(key).inspect
- redis.get(key)
+ cache.get(key)
end
private
- def redis
- @redis ||= Redis.new(url: ENV['REDIS_URL'])
+ def cache
+ @cache ||= Redis.new(url: ENV['REDIS_URL'])
end
end
end
end