Module: Dry::Tuple::TypeCoercer
- Defined in:
- lib/dry/tuple/type_coercer.rb
Class Method Summary collapse
Class Method Details
.[](*input, **opts) ⇒ Object
31 32 33 |
# File 'lib/dry/tuple/type_coercer.rb', line 31 def [](*input, **opts) call(input, **opts) end |
.TypeCoercer.call(array) ⇒ Object .TypeCoercer.call(input) ⇒ Object .TypeCoercer.call(type) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dry/tuple/type_coercer.rb', line 16 def call(input, returns: Undefined) case input when Array Dry::Types::Tuple.coerce(input) when Dry::Types::Tuple Undefined.default(returns, input) when Dry::Types::Constrained call(input.type, returns: input) when NilClass Dry::Types['nominal.tuple'] end end |