Class: Tavern::History::Redis

Inherits:
Base
  • Object
show all
Defined in:
lib/tavern/history/redis.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#hub

Instance Method Summary collapse

Methods inherited from Base

#history, #persist, #publish, #subscribe, #unsubscribe

Constructor Details

#initialize(hub, keyspace, redis = ::Redis.current) ⇒ Redis

Returns a new instance of Redis.



10
11
12
13
14
15
16
17
# File 'lib/tavern/history/redis.rb', line 10

def initialize(hub, keyspace, redis = ::Redis.current)
  super hub
  @redis       = redis
  @base_key    = "#{keyspace}:history"
  @counter     = "#{@base_key}:counter"
  @records     = "#{@base_key}:records"
  @stream_base = "#{@base_key}:entries"
end

Instance Attribute Details

#redisObject (readonly)

Returns the value of attribute redis.



8
9
10
# File 'lib/tavern/history/redis.rb', line 8

def redis
  @redis
end