Class: QuestionproRails::SurveyResponse
- Inherits:
-
Object
- Object
- QuestionproRails::SurveyResponse
- Defined in:
- lib/questionpro_rails/survey_response.rb
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#duplicate ⇒ Object
readonly
Returns the value of attribute duplicate.
-
#external_reference ⇒ Object
readonly
Returns the value of attribute external_reference.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#original_object ⇒ Object
readonly
Returns the value of attribute original_object.
-
#qp_response_set ⇒ Array<Hash>
readonly
Response Set collected from the survey response.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#response_status ⇒ Object
readonly
Returns the value of attribute response_status.
-
#time_taken ⇒ Object
readonly
Returns the value of attribute time_taken.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ SurveyResponse
constructor
A new instance of SurveyResponse.
-
#response_set ⇒ Array<QuestionproRails::ResponseSet>
Extract the Response Set from the hash stored inside qp_response_set attribute.
Constructor Details
#initialize(attributes) ⇒ SurveyResponse
Returns a new instance of SurveyResponse.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/questionpro_rails/survey_response.rb', line 13 def initialize (attributes) @id = attributes['id'] @country = attributes['country'] @duplicate = attributes['duplicate'] @external_reference = attributes['externalReference'] @ip_address = attributes['ipAddress'] @region = attributes['region'] @qp_response_set = attributes['responseSet'] @response_status = attributes['responseStatus'] @time_taken = attributes['timeTaken'] @timestamp = attributes['timestamp'] @original_object = attributes end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def country @country end |
#duplicate ⇒ Object (readonly)
Returns the value of attribute duplicate.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def duplicate @duplicate end |
#external_reference ⇒ Object (readonly)
Returns the value of attribute external_reference.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def external_reference @external_reference end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def id @id end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def ip_address @ip_address end |
#original_object ⇒ Object (readonly)
Returns the value of attribute original_object.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def original_object @original_object end |
#qp_response_set ⇒ Array<Hash> (readonly)
Returns Response Set collected from the survey response.
11 12 13 |
# File 'lib/questionpro_rails/survey_response.rb', line 11 def qp_response_set @qp_response_set end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def region @region end |
#response_status ⇒ Object (readonly)
Returns the value of attribute response_status.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def response_status @response_status end |
#time_taken ⇒ Object (readonly)
Returns the value of attribute time_taken.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def time_taken @time_taken end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
6 7 8 |
# File 'lib/questionpro_rails/survey_response.rb', line 6 def @timestamp end |
Instance Method Details
#response_set ⇒ Array<QuestionproRails::ResponseSet>
Extract the Response Set from the hash stored inside qp_response_set attribute.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/questionpro_rails/survey_response.rb', line 31 def response_set extracted_sets = [] unless self.qp_response_set.nil? self.qp_response_set.each do |set| extracted_sets.push(ResponseSet.new(set)) end end return extracted_sets end |