Class: Peek::Adapters::Redis
Instance Method Summary collapse
- #get(request_id) ⇒ Object
-
#initialize(options = {}) ⇒ Redis
constructor
A new instance of Redis.
- #save(request_id) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Redis
Returns a new instance of Redis.
7 8 9 10 |
# File 'lib/peek/adapters/redis.rb', line 7 def initialize( = {}) @client = .fetch(:client, ::Redis.new) @expires_in = Integer(.fetch(:expires_in, 60 * 30)) end |
Instance Method Details
#get(request_id) ⇒ Object
12 13 14 |
# File 'lib/peek/adapters/redis.rb', line 12 def get(request_id) @client.get("peek:requests:#{request_id}") end |