Class: PathfinderDeckBuilder::Deck

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDeck

Returns a new instance of Deck.



5
6
7
# File 'lib/deck.rb', line 5

def initialize
  @cards = []
end

Instance Attribute Details

#cardsObject

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