class Orbacle::UnionType

Attributes

types_set[R]

Public Class Methods

new(types) click to toggle source
# File lib/orbacle/union_type.rb, line 5
def initialize(types)
  @types_set = Set.new(types)
end

Public Instance Methods

==(other) click to toggle source
# File lib/orbacle/union_type.rb, line 15
def ==(other)
  self.class == other.class &&
    self.types_set == other.types_set
end
Also aliased as: eql?
bottom?() click to toggle source
# File lib/orbacle/union_type.rb, line 36
def bottom?
  false
end
each_possible_type() { |t| ... } click to toggle source
# File lib/orbacle/union_type.rb, line 28
def each_possible_type
  types.each do |type|
    type.each_possible_type do |t|
      yield t
    end
  end
end
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/orbacle/union_type.rb, line 20
def hash
  [
    self.class,
    self.types_set,
  ].hash ^ BIG_VALUE
end
types() click to toggle source
# File lib/orbacle/union_type.rb, line 11
def types
  @types_set
end