Class: OfcpScoring::ChinesePokerHand
- Inherits:
-
Object
- Object
- OfcpScoring::ChinesePokerHand
- Defined in:
- lib/ofcp_scoring/chinese_poker_hand.rb
Instance Method Summary collapse
- #back ⇒ Object
- #front ⇒ Object
-
#initialize(hand) ⇒ ChinesePokerHand
constructor
A new instance of ChinesePokerHand.
- #middle ⇒ Object
- #misset? ⇒ Boolean
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
#back ⇒ Object
14 15 16 |
# File 'lib/ofcp_scoring/chinese_poker_hand.rb', line 14 def back @hand[:back] end |
#front ⇒ Object
6 7 8 |
# File 'lib/ofcp_scoring/chinese_poker_hand.rb', line 6 def front @hand[:front] end |
#middle ⇒ Object
10 11 12 |
# File 'lib/ofcp_scoring/chinese_poker_hand.rb', line 10 def middle @hand[:middle] end |
#misset? ⇒ 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 |