Sha256: 50684d2049d8d1406df900e7b24b5bdb43a1a5f620c1539ac28b32e288a84feb

Contents?: true

Size: 354 Bytes

Versions: 15

Compression:

Stored size: 354 Bytes

Contents

# frozen_string_literal: true

require 'redis'

module Cache
  class RedisCache
    class << self
      def set(key, value, expiry = 3600)
        cache.set(key, value, ex: expiry)
      end

      def get(key)
        cache.get(key)
      end

    private

      def cache
        @cache ||= Redis.new(url: ENV['REDIS_URL'])
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sensei_eod_utils-0.0.53 lib/cache/redis_cache.rb
sensei_eod_utils-0.0.52 lib/cache/redis_cache.rb
sensei_eod_utils-0.0.51 lib/cache/redis_cache.rb
sensei_eod_utils-0.0.50 lib/cache/redis_cache.rb
sensei_eod_utils-0.0.49 lib/cache/redis_cache.rb
sensei_eod_utils-0.0.48 lib/cache/redis_cache.rb
sensei_eod_utils-0.0.47 lib/cache/redis_cache.rb
sensei_eod_utils-0.0.46 lib/cache/redis_cache.rb
sensei_eod_utils-0.0.45 lib/cache/redis.rb
sensei_eod_utils-0.0.44 lib/cache/redis.rb
sensei_eod_utils-0.0.43 lib/cache/redis.rb
sensei_eod_utils-0.0.42 lib/cache/redis.rb
sensei_eod_utils-0.0.41 lib/cache/redis.rb
sensei_eod_utils-0.0.40 lib/cache/redis.rb
sensei_eod_utils-0.0.39 lib/cache/redis.rb