Class: KOSapiClient::Configuration
- Inherits:
-
Struct
- Object
- Struct
- KOSapiClient::Configuration
- Defined in:
- lib/kosapi_client/configuration.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ base_url: 'https://kosapi.fit.cvut.cz/api/3' }
Instance Attribute Summary collapse
-
#auth_url ⇒ Object
Returns the value of attribute auth_url.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#connection_opts ⇒ Object
Returns the value of attribute connection_opts.
-
#token_url ⇒ Object
Returns the value of attribute token_url.
Instance Method Summary collapse
- #credentials ⇒ Object
-
#initialize(options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(options = {}) ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 |
# File 'lib/kosapi_client/configuration.rb', line 8 def initialize( = {}) DEFAULT_OPTIONS.merge().each do |option, value| self[option] = value end end |
Instance Attribute Details
#auth_url ⇒ Object
Returns the value of attribute auth_url
2 3 4 |
# File 'lib/kosapi_client/configuration.rb', line 2 def auth_url @auth_url end |
#base_url ⇒ Object
Returns the value of attribute base_url
2 3 4 |
# File 'lib/kosapi_client/configuration.rb', line 2 def base_url @base_url end |
#client_id ⇒ Object
Returns the value of attribute client_id
2 3 4 |
# File 'lib/kosapi_client/configuration.rb', line 2 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret
2 3 4 |
# File 'lib/kosapi_client/configuration.rb', line 2 def client_secret @client_secret end |
#connection_opts ⇒ Object
Returns the value of attribute connection_opts
2 3 4 |
# File 'lib/kosapi_client/configuration.rb', line 2 def connection_opts @connection_opts end |
#token_url ⇒ Object
Returns the value of attribute token_url
2 3 4 |
# File 'lib/kosapi_client/configuration.rb', line 2 def token_url @token_url end |
Instance Method Details
#credentials ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/kosapi_client/configuration.rb', line 14 def credentials if client_id && client_secret {client_id: client_id, client_secret: client_secret} else {} end end |