Class: NRSER::Types::Intersection

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

Instance Attribute Summary

Attributes inherited from Combinator

#types

Instance Method Summary collapse

Methods inherited from Combinator

#==, #from_s, #has_from_s?, #initialize

Methods inherited from Type

#check, #from_s, #has_from_s?, #initialize, #name, #respond_to?, short_name, #to_s

Constructor Details

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

Instance Method Details

#default_nameObject



73
74
75
# File 'lib/nrser/types/combinators.rb', line 73

def default_name
  "( #{ @types.map { |t| t.name }.join ' | ' } )"
end

#test(value) ⇒ Object



69
70
71
# File 'lib/nrser/types/combinators.rb', line 69

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