Module: Dry::Initializer::Dispatchers
- Extended by:
- Dispatchers
- Included in:
- Dispatchers
- Defined in:
- lib/dry/initializer/dispatchers.rb,
lib/dry/initializer/dispatchers/wrap_type.rb,
lib/dry/initializer/dispatchers/check_type.rb,
lib/dry/initializer/dispatchers/unwrap_type.rb,
lib/dry/initializer/dispatchers/prepare_ivar.rb,
lib/dry/initializer/dispatchers/prepare_reader.rb,
lib/dry/initializer/dispatchers/prepare_source.rb,
lib/dry/initializer/dispatchers/prepare_target.rb,
lib/dry/initializer/dispatchers/prepare_default.rb,
lib/dry/initializer/dispatchers/prepare_optional.rb,
lib/dry/initializer/dispatchers/build_nested_type.rb
Defined Under Namespace
Modules: BuildNestedType, CheckType, PrepareDefault, PrepareIvar, PrepareOptional, PrepareReader, PrepareSource, PrepareTarget, UnwrapType, WrapType
Instance Attribute Summary collapse
- #null ⇒ Object
- #null Defines a value to be set to unassigned attributes(Definesavaluetobesettounassignedattributes) ⇒ Object
Instance Method Summary collapse
-
#<<(dispatcher) ⇒ self
Registers a new dispatcher.
-
#call(**options) ⇒ Hash<Symbol, Objct>
Normalizes the source set of options.
Instance Attribute Details
#null ⇒ Object
71 72 73 |
# File 'lib/dry/initializer/dispatchers.rb', line 71 def null @null end |
#null Defines a value to be set to unassigned attributes(Definesavaluetobesettounassignedattributes) ⇒ Object
71 |
# File 'lib/dry/initializer/dispatchers.rb', line 71 attr_accessor :null |
Instance Method Details
#<<(dispatcher) ⇒ self
Registers a new dispatcher
79 80 81 82 |
# File 'lib/dry/initializer/dispatchers.rb', line 79 def <<(dispatcher) @pipeline = [dispatcher] + pipeline self end |
#call(**options) ⇒ Hash<Symbol, Objct>
Normalizes the source set of options
90 91 92 93 |
# File 'lib/dry/initializer/dispatchers.rb', line 90 def call(**) = {null: null, **} pipeline.reduce() { |opts, dispatcher| dispatcher.call(**opts) } end |