Class: NerdQuiz::Question
- Inherits:
-
Object
- Object
- NerdQuiz::Question
- Defined in:
- lib/nerd_quiz/question.rb
Class Method Summary collapse
Instance Method Summary collapse
- #answer ⇒ Object
-
#initialize(path) ⇒ Question
constructor
A new instance of Question.
- #label ⇒ Object
- #text ⇒ Object
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
#answer ⇒ Object
20 21 22 23 |
# File 'lib/nerd_quiz/question.rb', line 20 def answer set @question[:answer] end |
#label ⇒ Object
25 26 27 28 |
# File 'lib/nerd_quiz/question.rb', line 25 def label set @question[:label] end |
#text ⇒ Object
15 16 17 18 |
# File 'lib/nerd_quiz/question.rb', line 15 def text set @question[:text] end |