Class: Smartdown::Api::MultipleChoice
- Defined in:
- lib/smartdown/api/multiple_choice.rb
Instance Method Summary collapse
Methods inherited from Question
#body, #hint, #initialize, #title
Constructor Details
This class inherits a constructor from Smartdown::Api::Question
Instance Method Details
#name ⇒ Object
13 14 15 16 |
# File 'lib/smartdown/api/multiple_choice.rb', line 13 def name question = elements.find{|element| element.is_a? Smartdown::Model::Element::Question::MultipleChoice} question.name end |
#options ⇒ Object
6 7 8 9 10 11 |
# File 'lib/smartdown/api/multiple_choice.rb', line 6 def question = elements.find{|element| element.is_a? Smartdown::Model::Element::Question::MultipleChoice} question.choices.map do |choice| OpenStruct.new(:label => choice[1], :value => choice[0]) end end |