Define array member types with Dry::Types::Array::Member
mainThe Dry::Types::Array::Member class is used to define an array type where every element must conform to a specific member type. When using this type, the member type is applied to each element during coercion or validation.
Key behaviors:
- Coercion: Each element in the input array is passed through the defined
membertype. - Lax Mode: You can create a
laxversion of a member array, which allows for more permissive coercion of the individual elements. - Try: The
trymethod allows for safe processing of the array, returning a success result if all elements conform, or a failure result if any element fails or if the input is not an array.
# Note: While the class is internal, it is used via the public Array API
# to define types like:
# Types::Array(Integer)