Module: Surveygizmo::Client::Survey

Included in:
Surveygizmo::Client
Defined in:
lib/surveygizmo/client/survey.rb

Overview

Defines methods related to a SurveyGizmo survey Polls, Quizzes, Forms, Registrations are all surveys with simple flags activated to change the behavior of the object

Instance Method Summary collapse

Instance Method Details

#pollsObject

Temporary, until SG implements filtering by subtype



15
16
17
# File 'lib/surveygizmo/client/survey.rb', line 15

def polls
  surveys.select { |s| s._subtype == 'Poll' }
end

#survey(id, metaonly = false) ⇒ Object

Returns survey details for a given id

Parameters:

  • id (Integer, String)

    A SurveyGizmo AccountUser ID

  • metaonly (Boolean) (defaults to: false)

    Return only meta data



22
23
24
# File 'lib/surveygizmo/client/survey.rb', line 22

def survey(id, metaonly = false)
  get("survey/#{id}", :metaonly => metaonly)
end

#surveys(options = {}) ⇒ Object

List all surveys, optionally filtered

Parameters:

  • options (Hash) (defaults to: {})

    Option(s) used to refine search



10
11
12
# File 'lib/surveygizmo/client/survey.rb', line 10

def surveys(options = {})
  get('survey', options)
end