class Peek::Adapters::Redis
Public Class Methods
new(options = {})
click to toggle source
# File lib/peek/adapters/redis.rb, line 7 def initialize(options = {}) @client = options.fetch(:client, ::Redis.new) @expires_in = Integer(options.fetch(:expires_in, 60 * 30)) end
Public Instance Methods
get(request_id)
click to toggle source
# File lib/peek/adapters/redis.rb, line 12 def get(request_id) @client.get("peek:requests:#{request_id}") end
save(request_id)
click to toggle source
# File lib/peek/adapters/redis.rb, line 16 def save(request_id) @client.setex("peek:requests:#{request_id}", @expires_in, Peek.results.to_json) end