Class: Nokotime::Configuration
- Inherits:
-
Object
- Object
- Nokotime::Configuration
- Includes:
- Authentication
- Defined in:
- lib/nokotime/configuration.rb
Constant Summary collapse
- DEFAULT_URL =
"https://api.nokotime.com".freeze
Constants included from Authentication
Authentication::AUTHENTICATION_TYPE
Instance Attribute Summary collapse
- #auth_type ⇒ Object
- #max_concurrency ⇒ Object
- #token ⇒ Object
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Methods included from Authentication
#authorize_request, #valid_auth?
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 |
# File 'lib/nokotime/configuration.rb', line 12 def initialize @auth_type = nil @max_concurrency = nil @token = nil @url = DEFAULT_URL end |
Instance Attribute Details
#auth_type ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/nokotime/configuration.rb', line 19 def auth_type unless valid_auth?(@auth_type) raise( Errors::Configuration, "#{@auth_type} isn't valid type authentication." ) end @auth_type || raise( Errors::Configuration, "Authentication type missing." ) end |
#max_concurrency ⇒ Object
32 33 34 35 36 |
# File 'lib/nokotime/configuration.rb', line 32 def max_concurrency @max_concurrency || raise( Errors::Configuration, "Max concurrency missing." ) end |
#token ⇒ Object
38 39 40 41 42 |
# File 'lib/nokotime/configuration.rb', line 38 def token @token || raise( Errors::Configuration, "Token missing." ) end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/nokotime/configuration.rb', line 8 def url @url end |