lib/bcdd/result/config.rb in bcdd-result-0.11.0 vs lib/bcdd/result/config.rb in bcdd-result-0.12.0
- old
+ new
@@ -1,9 +1,7 @@
# frozen_string_literal: true
-require 'singleton'
-
require_relative 'config/options'
require_relative 'config/switcher'
require_relative 'config/switchers/addons'
require_relative 'config/switchers/constant_aliases'
require_relative 'config/switchers/features'
@@ -18,17 +16,23 @@
def initialize
@addon = Addons.switcher
@feature = Features.switcher
@constant_alias = ConstantAliases.switcher
@pattern_matching = PatternMatching.switcher
+ @and_then_ = CallableAndThen::Config.new
end
+ def and_then!
+ @and_then_
+ end
+
def freeze
addon.freeze
feature.freeze
constant_alias.freeze
pattern_matching.freeze
+ and_then!.freeze
super
end
def options
@@ -43,9 +47,11 @@
def to_h
options.transform_values(&:to_h)
end
def inspect
- "#<#{self.class.name} options=#{options.keys.sort.inspect}>"
+ "#<#{self.class.name} " \
+ "options=#{options.keys.sort.inspect} " \
+ "and_then!=#{and_then!.options.inspect}>"
end
end
end