Class: Smartdown::Api::PreviousQuestion
- Inherits:
-
Object
- Object
- Smartdown::Api::PreviousQuestion
- Extended by:
- Forwardable
- Defined in:
- lib/smartdown/api/previous_question.rb
Instance Attribute Summary collapse
-
#question ⇒ Object
readonly
Returns the value of attribute question.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(elements, response) ⇒ PreviousQuestion
constructor
A new instance of PreviousQuestion.
Constructor Details
#initialize(elements, response) ⇒ PreviousQuestion
Returns a new instance of PreviousQuestion.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/smartdown/api/previous_question.rb', line 10 def initialize(elements, response) @response = response if elements.find{|element| element.is_a? Smartdown::Model::Element::Question::MultipleChoice} @question = MultipleChoice.new(elements) elsif elements.find{|element| element.is_a? Smartdown::Model::Element::Question::Date} @question = DateQuestion.new(elements) elsif elements.find{|element| element.is_a? Smartdown::Model::Element::Question::Salary} @question = SalaryQuestion.new(elements) end end |
Instance Attribute Details
#question ⇒ Object (readonly)
Returns the value of attribute question.
8 9 10 |
# File 'lib/smartdown/api/previous_question.rb', line 8 def question @question end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
8 9 10 |
# File 'lib/smartdown/api/previous_question.rb', line 8 def response @response end |