Module: Tundengine::AlgebraicDataType

Included in:
Cards::Card, Declarations::LasVeinte, Player::InMatch, TuteValues::Capotes
Defined in:
lib/tundengine/algebraic_data_type.rb

Instance Method Summary collapse

Instance Method Details

#==(o) ⇒ Object Also known as: eql?



12
13
14
# File 'lib/tundengine/algebraic_data_type.rb', line 12

def ==(o)
  o.class == self.class && o.state == state
end

#hashObject



18
19
20
# File 'lib/tundengine/algebraic_data_type.rb', line 18

def hash
  state.hash
end

#initializeObject



4
5
6
# File 'lib/tundengine/algebraic_data_type.rb', line 4

def initialize
  freeze
end

#to_sObject



8
9
10
# File 'lib/tundengine/algebraic_data_type.rb', line 8

def to_s
  (state.one? ? state.first : state).to_s
end