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?, #has_to_data?, #initialize, #to_data

Methods inherited from Type

#check, #from_data, #from_s, #has_from_data?, #has_from_s?, #has_to_data?, #initialize, #name, #respond_to?, short_name, #to_data, #to_s

Constructor Details

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

Instance Method Details

#default_nameObject



121
122
123
# File 'lib/nrser/types/combinators.rb', line 121

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

#test(value) ⇒ Object



117
118
119
# File 'lib/nrser/types/combinators.rb', line 117

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