Class: NRSER::Types::Union

Inherits:
Combinator show all
Defined in:
lib/nrser/types/combinators.rb

Constant Summary collapse

JOIN_SYMBOL =

‘ ⋁ ’

' | '

Instance Attribute Summary

Attributes inherited from Combinator

#types

Instance Method Summary collapse

Methods inherited from Combinator

#==, #custom_from_s, #explain, #from_data, #has_from_data?, #has_from_s?, #has_to_data?, #initialize, #to_data

Methods inherited from Type

#===, #builtin_inspect, #check, #check!, #explain, #from_data, #from_s, #has_from_data?, #has_from_s?, #has_to_data?, #initialize, #inspect, #intersection, #name, #not, #respond_to?, #test, #to_data, #to_s, #union, #xor

Constructor Details

This class inherits a constructor from NRSER::Types::Combinator

Instance Method Details

#test?(value) ⇒ Boolean

Returns:

  • (Boolean)


179
180
181
# File 'lib/nrser/types/combinators.rb', line 179

def test? value
  @types.any? { |type| type.test value }
end