Method: ICFS::ConfigRedis#initialize

Defined in:
lib/icfs/config_redis.rb

#initialize(redis, base, opts = {}) ⇒ ConfigRedis

New instance

Parameters:

  • redis (Redis)

    The redis client

  • base (Config)

    The base Config store

  • opts (Hash) (defaults to: {})

    Options

Options Hash (opts):

  • :prefix (String)

    Prefix for Redis key

  • :expires (Integer)

    Expiration time in seconds



33
34
35
36
37
38
39
# File 'lib/icfs/config_redis.rb', line 33

def initialize(redis, base, opts={})
  super(base.setup)
  @redis = redis
  @base = base
  @pre = opts[:prefix] || ''
  @exp = opts[:expires] || 1*60*60 # 1 hour default
end