Class: SimpleLock::Config

Inherits:
Object
  • Object
show all
Extended by:
Delegation
Defined in:
lib/simple_lock/config.rb

Constant Summary collapse

DEFAULT_CONFIG =
OpenStruct.new(
  {
    retry_count: 3,
    retry_delay: 200,
    retry_jitter: 50,
    retry_proc: nil,
    key_prefix: "simple_lock:"
  }
)

Constants included from Delegation

Delegation::DELEGATION_RESERVED_KEYWORDS, Delegation::DELEGATION_RESERVED_METHOD_NAMES, Delegation::RUBY_RESERVED_KEYWORDS

Instance Method Summary collapse

Methods included from Delegation

delegate, delegate_missing_to

Constructor Details

#initialize ⇒ Config

Returns a new instance of Config.



19
20
21
# File 'lib/simple_lock/config.rb', line 19

def initialize
  @config = DEFAULT_CONFIG
end

Instance Method Details

#respond_to_missing?(method_name) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/simple_lock/config.rb', line 25

def respond_to_missing?(method_name, ...)
  DEFAULT_CONFIG.table.keys.include?(method_name.to_s.delete_suffix("=").to_sym)
end