Class: SurveyMonkey::Auth

Inherits:
Object
  • Object
show all
Defined in:
lib/survey_monkey/auth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(login = {}) ⇒ Auth

Returns a new instance of Auth.



4
5
6
7
8
9
10
11
12
# File 'lib/survey_monkey/auth.rb', line 4

def initialize( = {})
  file_name = [:dotenv_file_name] || SURVEY_MONKEY_DOTENV_PATH
  check_for_dotenv(file_name) unless env_vars_defined?

  @access_token   = [:access_token]  || ENV['SURVEY_MONKEY_ACCESS_TOKEN']
  @api_key        = [:api_key]       || ENV['SURVEY_MONKEY_API_KEY']
  @client_secret  = [:client_secret] || ENV['SURVEY_MONKEY_CLIENT_SECRET']
  @client_id      = [:client_id]     || ENV['SURVEY_MONKEY_CLIENT_ID']
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



3
4
5
# File 'lib/survey_monkey/auth.rb', line 3

def access_token
  @access_token
end

#api_keyObject (readonly)

Returns the value of attribute api_key.



3
4
5
# File 'lib/survey_monkey/auth.rb', line 3

def api_key
  @api_key
end

#client_idObject (readonly)

Returns the value of attribute client_id.



3
4
5
# File 'lib/survey_monkey/auth.rb', line 3

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.



3
4
5
# File 'lib/survey_monkey/auth.rb', line 3

def client_secret
  @client_secret
end