Class: Dry::Types::Array
- Inherits:
-
Definition
- Object
- Definition
- Dry::Types::Array
- Defined in:
- lib/dry/types/array.rb,
lib/dry/types/array/member.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Member
Instance Attribute Summary
Attributes inherited from Definition
Attributes included from Options
Instance Method Summary collapse
Methods inherited from Definition
[], #call, #constrained?, #default?, #failure, #initialize, #name, #primitive?, #result, #success, #try
Methods included from Builder
#constrained, #constrained_type, #constructor, #default, #enum, #maybe, #optional, #safe, #|
Methods included from Options
Constructor Details
This class inherits a constructor from Dry::Types::Definition
Instance Method Details
#member(type) ⇒ Array::Member
8 9 10 11 12 13 14 15 16 |
# File 'lib/dry/types/array.rb', line 8 def member(type) member = case type when String, Class then Types[type] else type end Array::Member.new(primitive, .merge(member: member)) end |