Class: NRSER::Types::Intersection

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

Overview

Intersection combinator (‘intersection`, `all_of`, `and`, `&).

Constant Summary collapse

JOIN_SYMBOL =

‘ ⋀ ’

' & '

Instance Attribute Summary

Attributes inherited from Combinator

#types

Instance Method Summary collapse

Methods inherited from Combinator

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

Methods inherited from Type

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

Constructor Details

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

Instance Method Details

#test?(value) ⇒ Boolean

Returns:



227
228
229
# File 'lib/nrser/types/combinators.rb', line 227

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