Class: GlimmerKlondikeSolitaire::Model::DealtPile

Inherits:
Object
  • Object
show all
Defined in:
app/glimmer_klondike_solitaire/model/dealt_pile.rb

Instance Method Summary collapse

Constructor Details

#initialize(game) ⇒ DealtPile

Returns a new instance of DealtPile.



4
5
6
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 4

def initialize(game)
  @game = game
end

Instance Method Details

#playing_cardsObject



20
21
22
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 20

def playing_cards
  @playing_cards ||= []
end

#push!(playing_card) ⇒ Object



12
13
14
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 12

def push!(playing_card)
  playing_cards.push(playing_card)
end

#remove!(card) ⇒ Object



16
17
18
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 16

def remove!(card)
  playing_cards.delete(card)
end

#reset!Object



8
9
10
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 8

def reset!
  playing_cards.clear
end