Class: GlimmerKlondikeSolitaire::Model::DealtPile
- Inherits:
-
Object
- Object
- GlimmerKlondikeSolitaire::Model::DealtPile
- Defined in:
- app/glimmer_klondike_solitaire/model/dealt_pile.rb
Instance Method Summary collapse
-
#initialize(game) ⇒ DealtPile
constructor
A new instance of DealtPile.
- #playing_cards ⇒ Object
- #push!(playing_card) ⇒ Object
- #remove!(card) ⇒ Object
- #reset! ⇒ Object
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_cards ⇒ Object
20 21 22 |
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 20 def @playing_cards ||= [] end |
#push!(playing_card) ⇒ Object
12 13 14 |
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 12 def push!() .push() end |
#remove!(card) ⇒ Object
16 17 18 |
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 16 def remove!(card) .delete(card) end |
#reset! ⇒ Object
8 9 10 |
# File 'app/glimmer_klondike_solitaire/model/dealt_pile.rb', line 8 def reset! .clear end |