Class: Brigitte::Deck

Inherits:
Object
  • Object
show all
Defined in:
lib/brigitte/deck.rb

Overview

A Deck generates and shuffles all cards except Joker. Joker is not used in Brigitte

Constant Summary collapse

SIGNS =
%w[   ].freeze
PREFIX =
%w[2 3 4 5 6 7 8 9 10 J Q K A].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDeck

Returns a new instance of Deck.



13
14
15
16
17
# File 'lib/brigitte/deck.rb', line 13

def initialize
  @cards = PREFIX.map do |prefix|
    SIGNS.map { |sign| Card.new(prefix, sign) }
  end.flatten.shuffle
end

Instance Attribute Details

#cardsObject

Returns the value of attribute cards.



8
9
10
# File 'lib/brigitte/deck.rb', line 8

def cards
  @cards
end