module Tundengine::AlgebraicDataType

Public Class Methods

new() click to toggle source
# File lib/tundengine/algebraic_data_type.rb, line 4
def initialize
  freeze
end

Public Instance Methods

==(o) click to toggle source
# File lib/tundengine/algebraic_data_type.rb, line 12
def ==(o)
  o.class == self.class && o.state == state
end
Also aliased as: eql?
eql?(o)
Alias for: ==
hash() click to toggle source
# File lib/tundengine/algebraic_data_type.rb, line 18
def hash
  state.hash
end
to_s() click to toggle source
# File lib/tundengine/algebraic_data_type.rb, line 8
def to_s
  (state.one? ? state.first : state).to_s
end

Protected Instance Methods

identifier() click to toggle source
# File lib/tundengine/algebraic_data_type.rb, line 28
def identifier
  []
end
state() click to toggle source
# File lib/tundengine/algebraic_data_type.rb, line 24
def state
  [self.class.name.split('::').last].concat identifier
end