Module: Dry::Initializer::Dispatchers::BuildNestedType

Extended by:
BuildNestedType
Included in:
BuildNestedType
Defined in:
lib/dry/initializer/dispatchers/build_nested_type.rb

Overview

Prepare nested data type from a block

Examples:

option :foo do
  option :bar
  option :qux
end

Instance Method Summary collapse

Instance Method Details

#call(parent:, source:, target:, type: nil, block: nil, **options) ⇒ Object

rubocop: disable Metrics/ParameterLists



14
15
16
17
18
19
# File 'lib/dry/initializer/dispatchers/build_nested_type.rb', line 14

def call(parent:, source:, target:, type: nil, block: nil, **options)
  check_certainty!(source, type, block)
  check_name!(target)
  type ||= build_nested_type(parent, target, block)
  { parent: parent, source: source, target: target, type: type, **options }
end