Class: NerdQuiz::Question

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Question

Returns a new instance of Question.



9
10
11
12
13
# File 'lib/nerd_quiz/question.rb', line 9

def initialize(path)
  @path = path
  @question = {}
  @parsed = {}
end

Class Method Details

.get(path) ⇒ Object



4
5
6
# File 'lib/nerd_quiz/question.rb', line 4

def get(path)
  self.new path
end

Instance Method Details

#answerObject



20
21
22
23
# File 'lib/nerd_quiz/question.rb', line 20

def answer
  set
  @question[:answer]
end

#labelObject



25
26
27
28
# File 'lib/nerd_quiz/question.rb', line 25

def label
  set
  @question[:label]
end

#textObject



15
16
17
18
# File 'lib/nerd_quiz/question.rb', line 15

def text
  set
  @question[:text]
end