Class: Question
- Inherits:
-
Object
- Object
- Question
- Defined in:
- lib/question.rb
Instance Attribute Summary collapse
-
#answer ⇒ Object
Returns the value of attribute answer.
-
#text ⇒ Object
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(question = nil) ⇒ Question
constructor
A new instance of Question.
Constructor Details
#initialize(question = nil) ⇒ Question
Returns a new instance of Question.
4 5 6 |
# File 'lib/question.rb', line 4 def initialize(question=nil) @text = question end |
Instance Attribute Details
#answer ⇒ Object
Returns the value of attribute answer.
2 3 4 |
# File 'lib/question.rb', line 2 def answer @answer end |
#text ⇒ Object
Returns the value of attribute text.
2 3 4 |
# File 'lib/question.rb', line 2 def text @text end |
Class Method Details
.build(question_list) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/question.rb', line 8 def self.build(question_list) container = [] question_list.each {|question| container << self.new(question) } container end |