Class: Dry::Types::Array

Inherits:
Nominal show all
Defined in:
lib/dry/types/array.rb,
lib/dry/types/array/member.rb,
lib/dry/types/array/constructor.rb

Direct Known Subclasses

Member

Defined Under Namespace

Classes: Constructor, Member

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Dry::Types::Nominal

Instance Attribute Details

#optionsHash (readonly) Originally defined in module Options

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.

Returns:

Instance Method Details

#constructor_typeObject

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

Parameters:

Returns:



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, **options, member: member)
end