class Surveymonkey::Client

Class encapsulating the HTTParty client used to communicate with the SurveyMonkey API.

Attributes

access_token[R]

public methods

api_key[R]

public methods

baseuri[R]

public methods

Public Class Methods

new(baseuri, access_token, api_key) click to toggle source

Create a new Surveymonkey::Client object. Requires the following parameters:

# File lib/surveymonkey/client.rb, line 25
def initialize(baseuri, access_token, api_key)
  begin
    @baseuri      = baseuri
    @access_token = access_token
    @api_key      = api_key

    self.class.logger $log, :debug

    $log.debug(sprintf("%s: setting base_uri to '%s'", __method__, @baseuri))
    self.class.base_uri @baseuri

    http_headers = _http_headers(@access_token)
    self.class.headers http_headers

  rescue StandardError => e
    $log.error(sprintf("%s: %s", __method__, e.message))
    raise e
  end
end

Public Instance Methods

to_s() click to toggle source

Stringify a Surveymonkey::Client object

# File lib/surveymonkey/client.rb, line 48
def to_s
  self.baseuri
end