Support of wrapped and nested types
class Test
extend Dry::Initializer
# Wrapped type
option :foo, [proc(&:to_s)]
# Nested type
option :bar do
option :baz, proc(&:to_s)
end
# Both wrapped and nested type
option :qux, [] do
option :sax, proc(&:to_s)
end
end
test = Test.new foo: 4, bar: { baz: 5 }, qux: { sax: 6 }
# Wrapped type wraps a coerced value to array
test.foo # => ["4"]
# Nested type builds the nested structure
test.bar.baz # => "5"
# Their composition wraps the result of nesting
test.qux.first.sax # => 6