Module: GogoKit::Configuration
- Included in:
- Client
- Defined in:
- lib/gogokit/configuration.rb
Overview
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_root_endpoint ⇒ Object
Returns the value of attribute api_root_endpoint.
-
#authorization_endpoint ⇒ Object
Returns the value of attribute authorization_endpoint.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#oauth_token_endpoint ⇒ Object
Returns the value of attribute oauth_token_endpoint.
Instance Method Summary collapse
-
#api_environment ⇒ Symbol
Gets the current API environment in use.
-
#api_environment=(api_environment) ⇒ Object
Sets the API environment to be used.
-
#reset! ⇒ Object
Reset configuration options to default values.
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
8 9 10 |
# File 'lib/gogokit/configuration.rb', line 8 def access_token @access_token end |
#api_root_endpoint ⇒ Object
Returns the value of attribute api_root_endpoint.
8 9 10 |
# File 'lib/gogokit/configuration.rb', line 8 def api_root_endpoint @api_root_endpoint end |
#authorization_endpoint ⇒ Object
Returns the value of attribute authorization_endpoint.
8 9 10 |
# File 'lib/gogokit/configuration.rb', line 8 def @authorization_endpoint end |
#client_id ⇒ Object
Returns the value of attribute client_id.
8 9 10 |
# File 'lib/gogokit/configuration.rb', line 8 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
8 9 10 |
# File 'lib/gogokit/configuration.rb', line 8 def client_secret @client_secret end |
#oauth_token_endpoint ⇒ Object
Returns the value of attribute oauth_token_endpoint.
8 9 10 |
# File 'lib/gogokit/configuration.rb', line 8 def oauth_token_endpoint @oauth_token_endpoint end |
Instance Method Details
#api_environment ⇒ Symbol
Gets the current API environment in use
environment is not :production or :sandbox.
28 29 30 |
# File 'lib/gogokit/configuration.rb', line 28 def api_environment @api_environment end |
#api_environment=(api_environment) ⇒ Object
Sets the API environment to be used. Setting this value will configure the values for #api_root_endpoint, #oauth_token_endpoint and #authorization_endpoint. See developer.viagogo.net/#sandbox-environment
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/gogokit/configuration.rb', line 37 def api_environment=(api_environment) @api_environment = api_environment.to_sym validate_configuration_api_environment! self.api_root_endpoint = GogoKit::Default::API_ROOT_ENDPOINTS[@api_environment] self.oauth_token_endpoint = GogoKit::Default::OAUTH_TOKEN_ENDPOINTS[@api_environment] self. = GogoKit::Default::AUTHORIZATION_ENDPOINTS[@api_environment] end |