class OfcpScoring::OrganizedHand
Public Class Methods
new(organized_hand)
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 4 def initialize(organized_hand) @hand = organized_hand end
Public Instance Methods
all_suits_match?()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 41 def all_suits_match? @hand[:all_suits_match] end
four_cards_match?()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 37 def four_cards_match? @hand[:four_cards_match] end
ranks()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 8 def ranks @hand[:ranks] end
ranks_in_order?()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 45 def ranks_in_order? @hand[:ranks_in_order] end
sequences()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 12 def sequences ranks = @hand[:ranks].reverse prev = ranks[0] ranks.slice_before { |cur| prev, prev2 = cur, prev prev2 - 1 != prev }.to_a end
suits()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 21 def suits @hand[:suits] end
three_card_hand?()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 49 def three_card_hand? @hand[:three_card_hand] end
three_cards_match?()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 33 def three_cards_match? @hand[:three_cards_match] end
two_cards_match?()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 25 def two_cards_match? @hand[:two_cards_match] end
two_different_cards_match?()
click to toggle source
# File lib/ofcp_scoring/organized_hand.rb, line 29 def two_different_cards_match? @hand[:two_different_cards_match] end