Class: Reporter::Record::Response::MultipleChoice

Inherits:
Base
  • Object
show all
Defined in:
lib/reporter/record/response/multiple_choice.rb

Overview

Public: Represents a response to a question with multiple

option answers.

Call #answered_options to get an Array of Strings representing the selected options.

Instance Method Summary collapse

Methods included from BaseModule

#question_prompt

Methods inherited from Base

#==, #hash, #initialize

Constructor Details

This class inherits a constructor from Reporter::Record::Base

Instance Method Details

#answered_optionsObject

Public: Represents the answered options.

Returns an Array of Strings representing the options

selected.


16
17
18
# File 'lib/reporter/record/response/multiple_choice.rb', line 16

def answered_options
  @answered_options ||= @data["answeredOptions"].map(&:to_s)
end