Class: Farce::Internal::DryTypes::SequenceType

Inherits:
CollectionType show all
Defined in:
lib/farce/integrations/dry_types.rb

Overview

A Vector or Set type that applies a member type to every input value.

Instance Attribute Summary

Attributes inherited from CollectionType

#source

Dry Types Integration collapse

Methods inherited from CollectionType

#call, #constrained?, #default?, #inspect, #meta, #name, #optional?, #primitive?, #pristine, #to_ast, #to_proc, #try, #valid?, #with

Instance Method Details

#of(member) ⇒ SequenceType

Apply a dry type to every member before Farce construction.

Parameters:

  • member (Dry::Types::Type, #call) —

    The member type.

Returns:



311
312
313
314
315
# File 'lib/farce/integrations/dry_types.rb', line 311

def of(member)
  typed = DryTypes.collection_source(source).of(member)
  typed = DryTypes.restore_optional_source(source, typed)
  self.class.new(typed, kind:, configuration:)
end