Class: Surveymonkey::Survey
- Inherits:
-
Object
- Object
- Surveymonkey::Survey
- Defined in:
- lib/surveymonkey_api/survey.rb
Overview
Survey
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #details(options = {}) ⇒ Object
-
#initialize(id) ⇒ Survey
constructor
A new instance of Survey.
- #raw_responses(options = {}) ⇒ Object
- #responses(options = {}) ⇒ Object
Constructor Details
#initialize(id) ⇒ Survey
Returns a new instance of Survey.
6 7 8 |
# File 'lib/surveymonkey_api/survey.rb', line 6 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/surveymonkey_api/survey.rb', line 4 def id @id end |
Instance Method Details
#details(options = {}) ⇒ Object
10 11 12 |
# File 'lib/surveymonkey_api/survey.rb', line 10 def details( = {}) @details ||= client.survey_details(id, ) end |
#raw_responses(options = {}) ⇒ Object
14 15 16 |
# File 'lib/surveymonkey_api/survey.rb', line 14 def raw_responses( = {}) client.survey_responses(id, ) end |
#responses(options = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/surveymonkey_api/survey.rb', line 18 def responses( = {}) @responses ||= client.survey_responses(id, )['data'].each_with_object([]) do |response, arr| arr << Surveymonkey::Response.new(id, response['id']) end end |