poker-ranking 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/card.rb +2 -2
- data/lib/poker_ranking.rb +1 -1
- metadata +1 -1
data/lib/card.rb
CHANGED
|
@@ -7,13 +7,13 @@ module PokerRanking
|
|
|
7
7
|
SUITS = %w(Hearts Diamonds Spades Clubs)
|
|
8
8
|
|
|
9
9
|
def initialize(card_data)
|
|
10
|
-
@suit = card_data.has_key?(:suit) ? card_data[:suit] : card_data['suit']
|
|
10
|
+
@suit = (card_data.has_key?(:suit) ? card_data[:suit] : card_data['suit']).capitalize
|
|
11
11
|
@rank = card_data.has_key?(:rank) ? card_data[:rank].to_s : card_data['rank'].to_s
|
|
12
12
|
set_value_by_rank_name(@rank)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def set_value_by_rank_name(rank)
|
|
16
|
-
@value = RANKS.index(rank) + 2
|
|
16
|
+
@value = RANKS.index(rank.capitalize) + 2
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def worth_less_than(other_hand)
|
data/lib/poker_ranking.rb
CHANGED