Class: Stoplight::DataStore::Redis

Inherits:
Base
  • Object
show all
Defined in:
sig/stoplight/data_store.rbs,
lib/stoplight/data_store.rb

Overview

Note:

This is a configuration object, not the storage implementation itself.

Configuration for Redis-backed Stoplight storage.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(redis, warn_on_clock_skew: true) ⇒ Redis

Returns a new instance of Redis.

Parameters:

  • redis (::Redis, ConnectionPool<::Redis>)
  • warn_on_clock_skew (Boolean) (defaults to: true)

    (true) Whether to warn about clock skew between Redis and the application server

  • (redis)
  • warn_on_clock_skew: (Boolean) (defaults to: true)


19
20
21
22
# File 'lib/stoplight/data_store.rb', line 19

def initialize(redis, warn_on_clock_skew: true)
  @warn_on_clock_skew = warn_on_clock_skew
  @redis = redis
end

Instance Attribute Details

#redisredis

Returns the value of attribute redis.

Returns:



10
11
12
# File 'lib/stoplight/data_store.rb', line 10

def redis
  @redis
end

#warn_on_clock_skewBoolean

Returns the value of attribute warn_on_clock_skew.

Returns:

  • (Boolean)


14
15
16
# File 'lib/stoplight/data_store.rb', line 14

def warn_on_clock_skew
  @warn_on_clock_skew
end