class Blackjack::Deck
Attributes
cards[R]
Public Class Methods
new()
click to toggle source
# File lib/blackjack/deck.rb, line 5 def initialize @cards = Card::SUITS.reduce([]) do |product, suit| product + Card::RANKS.map do |rank| Card.new(rank, suit) end end end
Public Instance Methods
shuffle()
click to toggle source
# File lib/blackjack/deck.rb, line 13 def shuffle @cards.shuffle! self end