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
- #==(o) ⇒ Object (also: #eql?)
- #hash ⇒ Object
- #initialize ⇒ Object
- #to_s ⇒ Object
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 |
#hash ⇒ Object
18 19 20 |
# File 'lib/tundengine/algebraic_data_type.rb', line 18 def hash state.hash end |
#initialize ⇒ Object
4 5 6 |
# File 'lib/tundengine/algebraic_data_type.rb', line 4 def initialize freeze end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/tundengine/algebraic_data_type.rb', line 8 def to_s (state.one? ? state.first : state).to_s end |