Class: Module::DisjunctiveType

Inherits:
CompositeType show all
Defined in:
lib/composite_type.rb

Constant Summary

Constants inherited from CompositeType

CompositeType::CACHE, CompositeType::CACHE_MUTEX

Instance Attribute Summary

Attributes inherited from CompositeType

#_t

Instance Method Summary collapse

Methods inherited from CompositeType

#initialize, #name, new_cached

Methods inherited from Module

#&, #of, #with, #|, #~@

Constructor Details

This class inherits a constructor from Module::CompositeType

Instance Method Details

#===(x) ⇒ Object



71
72
73
# File 'lib/composite_type.rb', line 71

def === x
   @_t[0] === x or @_t[1] === x
end

#to_sObject



74
75
76
# File 'lib/composite_type.rb', line 74

def to_s
  @to_s ||= "(#{@_t[0]}|#{@_t[1]})".freeze
end