Class: SurveyMonkeyApi::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty, SurveyResponses, Surveys, Users
Defined in:
lib/surveymonkey/client.rb,
lib/surveymonkey/client/users.rb,
lib/surveymonkey/client/surveys.rb,
lib/surveymonkey/client/responses.rb

Overview

Client class for api requests

Defined Under Namespace

Modules: SurveyResponses, Surveys, Users

Instance Method Summary collapse

Methods included from SurveyResponses

#response, #response_with_details, #responses

Methods included from Surveys

#survey, #survey_with_details, #surveys

Methods included from Users

#me

Constructor Details

#initialize(_args = {}) ⇒ Client

Returns a new instance of Client.



17
18
19
20
# File 'lib/surveymonkey/client.rb', line 17

def initialize(_args = {})
    access_token = ENV['SURVEY_MONKEY_TOKEN']
    self.class.default_options.merge!(headers: { 'Authorization' => "Bearer #{access_token}", 'Content-Type' => 'application/json' })
end