Class: FlashCard

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

Overview

MODEL=========================

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ FlashCard

Returns a new instance of FlashCard.



25
26
27
28
29
30
# File 'lib/model.rb', line 25

def initialize(args = {})
# generates flashcard objects based on hash keys (csv fields)
  @category = args[:category]
  @question = args[:question]
  @answer = args[:answer]
end

Instance Attribute Details

#answerObject (readonly)

Models our flashcard objects



22
23
24
# File 'lib/model.rb', line 22

def answer
  @answer
end

#answeredObject

Returns the value of attribute answered.



23
24
25
# File 'lib/model.rb', line 23

def answered
  @answered
end

#categoryObject (readonly)

Models our flashcard objects



22
23
24
# File 'lib/model.rb', line 22

def category
  @category
end

#questionObject (readonly)

Models our flashcard objects



22
23
24
# File 'lib/model.rb', line 22

def question
  @question
end