Class: Dry::Data::Type::Array
- Inherits:
-
Dry::Data::Type
- Object
- Dry::Data::Type
- Dry::Data::Type::Array
- Defined in:
- lib/dry/data/type/array.rb
Instance Attribute Summary
Attributes inherited from Dry::Data::Type
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Dry::Data::Type
[], #call, #constrained, #enum, #initialize, #name, passthrough_constructor, strict_constructor, #valid?, #|
Constructor Details
This class inherits a constructor from Dry::Data::Type
Class Method Details
.constructor(array_constructor, value_constructor, input) ⇒ Object
5 6 7 |
# File 'lib/dry/data/type/array.rb', line 5 def self.constructor(array_constructor, value_constructor, input) array_constructor[input].map(&value_constructor) end |
Instance Method Details
#member(type) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/dry/data/type/array.rb', line 9 def member(type) self.class.new( self.class.method(:constructor).to_proc.curry.(constructor, type.constructor), primitive ) end |