Class: Dry::Types::Array
- Defined in:
- lib/dry/types/array.rb,
lib/dry/types/array/member.rb,
lib/dry/types/array/constructor.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Constructor, Member
Constant Summary
Constants inherited from Nominal
Instance Attribute Summary
Attributes inherited from Nominal
Attributes included from Options
Instance Method Summary collapse
- #constructor_type ⇒ Object private
-
#of(type) ⇒ Array::Member
Build an array type with a member type.
Methods inherited from Nominal
[], #call_safe, #call_unsafe, #coerce, #constrained?, #default?, #failure, #initialize, #lax, #name, #optional?, #primitive?, #success, #to_ast, #to_proc, #try, #try_coerce
Methods included from Printable
Methods included from Builder
#&, #>, #constrained, #constrained_type, #constructor, #default, #enum, #fallback, #lax, #maybe, #optional, #|
Methods included from Meta
#initialize, #meta, #pristine, #with
Methods included from Options
Methods included from Type
Constructor Details
This class inherits a constructor from Dry::Types::Nominal
Instance Method Details
#constructor_type ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/dry/types/array.rb', line 27 def constructor_type ::Dry::Types::Array::Constructor end |
#of(type) ⇒ Array::Member
Build an array type with a member type
16 17 18 19 20 21 22 23 24 |
# File 'lib/dry/types/array.rb', line 16 def of(type) member = case type when String then Types[type] else type end Array::Member.new(primitive, **, member: member) end |