Class: Cubscout::Config
- Inherits:
-
Object
- Object
- Cubscout::Config
- Defined in:
- lib/cubscout/config.rb
Overview
Constant Summary collapse
- DEFAULT_API_PREFIX =
'https://api.helpscout.net/v2'
Class Attribute Summary collapse
-
.api_prefix ⇒ String
Base url of Helpscout’s API V2.
-
.client_id ⇒ Object
writeonly
Sets the attribute client_id.
-
.client_secret ⇒ Object
writeonly
Sets the attribute client_secret.
Class Method Summary collapse
-
.oauth_token ⇒ String
OAuth token used in every request header: Authorization: Bearer #{Cubscout::Config.oauth_token}.
-
.reset! ⇒ Object
Resets
client_id,client_secret, andoauth_clientto null values,api_prefixto DEFAULT_API_PREFIX.
Class Attribute Details
.api_prefix ⇒ String
Returns Base url of Helpscout’s API V2.
17 18 19 |
# File 'lib/cubscout/config.rb', line 17 def api_prefix @api_prefix ||= DEFAULT_API_PREFIX end |
.client_id=(value) ⇒ Object (writeonly)
Sets the attribute client_id
14 15 16 |
# File 'lib/cubscout/config.rb', line 14 def client_id=(value) @client_id = value end |
.client_secret=(value) ⇒ Object (writeonly)
Sets the attribute client_secret
14 15 16 |
# File 'lib/cubscout/config.rb', line 14 def client_secret=(value) @client_secret = value end |
Class Method Details
.oauth_token ⇒ String
Returns OAuth token used in every request header: Authorization: Bearer #{Cubscout::Config.oauth_token}.
31 32 33 |
# File 'lib/cubscout/config.rb', line 31 def oauth_token access_token.token end |
.reset! ⇒ Object
Resets client_id, client_secret, and oauth_client to null values, api_prefix to DEFAULT_API_PREFIX
23 24 25 26 27 |
# File 'lib/cubscout/config.rb', line 23 def reset! @client_id = @client_secret = nil @access_token = @oauth_client = nil @api_prefix = DEFAULT_API_PREFIX end |