Class: BothIsGood::LocalConfiguration

Inherits:
Configuration show all
Defined in:
lib/both_is_good/local_configuration.rb

Constant Summary collapse

LOCAL_ATTRIBUTES =
%i[original replacement comparator].freeze

Constants inherited from Configuration

Configuration::ATTRIBUTES, Configuration::DEFAULTS, Configuration::UNSUPPLIED

Instance Method Summary collapse

Methods inherited from Configuration

#dup, global, #on_compare=, #on_hook_error=, #on_mismatch=, #on_primary_error=, #on_secondary_error=, #rate=, #register_comparator, #switch=

Constructor Details

#initialize(base_config, owner:, original:, replacement:, **opts) ⇒ LocalConfiguration

Returns a new instance of LocalConfiguration.



7
8
9
10
11
12
13
# File 'lib/both_is_good/local_configuration.rb', line 7

def initialize(base_config, owner:, original:, replacement:, **opts)
  comparator = opts.delete(:comparator)
  super(base_config, **opts)
  @original = validated_method(owner, :original, original)
  @replacement = validated_method(owner, :replacement, replacement)
  @comparator = validated_comparator(comparator)
end