Class: OfcpScoring::ChinesePokerHand

Inherits:
Object
  • Object
show all
Defined in:
lib/ofcp_scoring/chinese_poker_hand.rb

Instance Method Summary collapse

Constructor Details

#initialize(hand) ⇒ ChinesePokerHand

Returns a new instance of ChinesePokerHand.



2
3
4
# File 'lib/ofcp_scoring/chinese_poker_hand.rb', line 2

def initialize(hand)
  @hand = hand
end

Instance Method Details

#backObject



14
15
16
# File 'lib/ofcp_scoring/chinese_poker_hand.rb', line 14

def back
  @hand[:back]
end

#frontObject



6
7
8
# File 'lib/ofcp_scoring/chinese_poker_hand.rb', line 6

def front
  @hand[:front]
end

#middleObject



10
11
12
# File 'lib/ofcp_scoring/chinese_poker_hand.rb', line 10

def middle
  @hand[:middle]
end

#misset?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/ofcp_scoring/chinese_poker_hand.rb', line 18

def misset?
  true if front > middle || middle > back || front > back
end