Class: Surveymonkey::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty, Survey
Defined in:
lib/surveymonkey_api/client.rb,
lib/surveymonkey_api/client/survey.rb

Overview

Client

Defined Under Namespace

Modules: Survey

Instance Method Summary collapse

Methods included from Survey

#all_survey_responses, #survey_details, #survey_folder, #survey_folders, #survey_response, #survey_responses, #surveys

Constructor Details

#initialize(access_token = nil) ⇒ Client

Returns a new instance of Client.



9
10
11
12
# File 'lib/surveymonkey_api/client.rb', line 9

def initialize(access_token = nil)
  @access_token = access_token || ENV['SURVEYMONKEY_API_TOKEN']
  self.class.default_options.merge!(headers: { 'Authorization' => "bearer #{@access_token}" })
end