Class: Card

Inherits:
Deck show all
Defined in:
lib/classes/Card.rb

Instance Attribute Summary collapse

Attributes inherited from Deck

#card_counts, #date_created, #date_modified, #deck_name, #familiarity_rate, #id, #test_counts, #topic

Instance Method Summary collapse

Methods inherited from Deck

add_deck_to_count, add_familiar_card_to_count, add_test_to_count, #back_to_main_menu, #del_deck, #view_deck

Constructor Details

#initialize(card_id, deck, card_name, description) ⇒ Card

Returns a new instance of Card.



7
8
9
10
11
12
13
# File 'lib/classes/Card.rb', line 7

def initialize(card_id, deck, card_name, description)
  @card_id = card_id
  @deck = deck
  @card_name = card_name
  @description = description
  # Deck.add_card(deck)
end

Instance Attribute Details

#card_idObject

Returns the value of attribute card_id.



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

def card_id
  @card_id
end

#card_nameObject

Returns the value of attribute card_name.



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

def card_name
  @card_name
end

#deckObject

Returns the value of attribute deck.



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

def deck
  @deck
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

Instance Method Details

#to_aObject



15
16
17
# File 'lib/classes/Card.rb', line 15

def to_a
  [@card_id, @deck, @card_name, @description] 
end