Class: IdempotentEnumerable::Configurator
- Inherits:
-
Object
- Object
- IdempotentEnumerable::Configurator
- Defined in:
- lib/idempotent_enumerable/configurator.rb
Constant Summary collapse
- REDEFINEABLE =
i[map flat_map collect collect_concat].freeze
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(host) ⇒ Configurator
constructor
A new instance of Configurator.
- #redefine_map!(only: REDEFINEABLE, all: nil) ⇒ Object
Constructor Details
#initialize(host) ⇒ Configurator
Returns a new instance of Configurator.
5 6 7 |
# File 'lib/idempotent_enumerable/configurator.rb', line 5 def initialize(host) @host = host end |
Instance Attribute Details
#constructor ⇒ Object
9 10 11 |
# File 'lib/idempotent_enumerable/configurator.rb', line 9 def constructor @constructor || :new end |
Instance Method Details
#redefine_map!(only: REDEFINEABLE, all: nil) ⇒ Object
15 16 17 18 |
# File 'lib/idempotent_enumerable/configurator.rb', line 15 def redefine_map!(only: REDEFINEABLE, all: nil) (Array(only) & REDEFINEABLE).each { |method| redefine(method, all) } self end |