Class: Card
Instance Attribute Summary collapse
-
#card_id ⇒ Object
Returns the value of attribute card_id.
-
#card_name ⇒ Object
Returns the value of attribute card_name.
-
#deck ⇒ Object
Returns the value of attribute deck.
-
#description ⇒ Object
Returns the value of attribute description.
Attributes inherited from Deck
#card_counts, #date_created, #date_modified, #deck_name, #familiarity_rate, #id, #test_counts, #topic
Instance Method Summary collapse
-
#initialize(card_id, deck, card_name, description) ⇒ Card
constructor
A new instance of Card.
- #to_a ⇒ Object
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_id ⇒ Object
Returns the value of attribute card_id.
5 6 7 |
# File 'lib/classes/Card.rb', line 5 def card_id @card_id end |
#card_name ⇒ Object
Returns the value of attribute card_name.
5 6 7 |
# File 'lib/classes/Card.rb', line 5 def card_name @card_name end |
#deck ⇒ Object
Returns the value of attribute deck.
5 6 7 |
# File 'lib/classes/Card.rb', line 5 def deck @deck end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/classes/Card.rb', line 5 def description @description end |
Instance Method Details
#to_a ⇒ Object
15 16 17 |
# File 'lib/classes/Card.rb', line 15 def to_a [@card_id, @deck, @card_name, @description] end |