Class: PathfinderDeckBuilder::Deck
- Inherits:
-
Object
- Object
- PathfinderDeckBuilder::Deck
- Defined in:
- lib/deck.rb
Instance Attribute Summary collapse
-
#cards ⇒ Object
Returns the value of attribute cards.
Instance Method Summary collapse
-
#initialize ⇒ Deck
constructor
A new instance of Deck.
- #save_deck(to_file = "new_deck.json") ⇒ Object
Constructor Details
#initialize ⇒ Deck
Returns a new instance of Deck.
5 6 7 |
# File 'lib/deck.rb', line 5 def initialize @cards = [] end |
Instance Attribute Details
#cards ⇒ Object
Returns the value of attribute cards.
3 4 5 |
# File 'lib/deck.rb', line 3 def cards @cards end |
Instance Method Details
#save_deck(to_file = "new_deck.json") ⇒ Object
9 10 11 12 13 |
# File 'lib/deck.rb', line 9 def save_deck(to_file="new_deck.json") File.open(to_file, "w") do |file| file.puts JSON.pretty_generate(@cards) end end |