Class: SurveyMonkey::Auth
- Inherits:
-
Object
- Object
- SurveyMonkey::Auth
- Defined in:
- lib/survey_monkey/auth.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
Instance Method Summary collapse
-
#initialize(login = {}) ⇒ Auth
constructor
A new instance of Auth.
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(login = {}) file_name = login[:dotenv_file_name] || SURVEY_MONKEY_DOTENV_PATH check_for_dotenv(file_name) unless env_vars_defined? @access_token = login[:access_token] || ENV['SURVEY_MONKEY_ACCESS_TOKEN'] @api_key = login[:api_key] || ENV['SURVEY_MONKEY_API_KEY'] @client_secret = login[:client_secret] || ENV['SURVEY_MONKEY_CLIENT_SECRET'] @client_id = login[:client_id] || ENV['SURVEY_MONKEY_CLIENT_ID'] end |
Instance Attribute Details
#access_token ⇒ Object (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_key ⇒ Object (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_id ⇒ Object (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_secret ⇒ Object (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 |