Class: CapitalOnTap::Configuration
- Inherits:
-
Object
- Object
- CapitalOnTap::Configuration
- Defined in:
- lib/capital_on_tap/configuration.rb
Constant Summary collapse
- AUTH_DOMAINS =
{ production: 'https://api-auth.capitalontap.com', development: 'https://prelive-api-auth.capitalontap.com' }.freeze
- API_DOMAINS =
{ production: 'https://api-partner.capitalontap.com', development: 'https://prelive-api-partner.capitalontap.com' }.freeze
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#debug ⇒ Object
writeonly
Sets the attribute debug.
-
#env ⇒ Object
Returns the value of attribute env.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #base_auth_url ⇒ Object
- #base_url ⇒ Object
- #debug? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 |
# File 'lib/capital_on_tap/configuration.rb', line 18 def initialize @client_id = '' @client_secret = '' @username = '' @password = '' @env = defined?(Rails) ? Rails.env : :development @debug = false end |
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/capital_on_tap/configuration.rb', line 5 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
5 6 7 |
# File 'lib/capital_on_tap/configuration.rb', line 5 def client_secret @client_secret end |
#debug=(value) ⇒ Object (writeonly)
Sets the attribute debug
6 7 8 |
# File 'lib/capital_on_tap/configuration.rb', line 6 def debug=(value) @debug = value end |
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/capital_on_tap/configuration.rb', line 5 def env @env end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/capital_on_tap/configuration.rb', line 5 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/capital_on_tap/configuration.rb', line 5 def username @username end |
Instance Method Details
#base_auth_url ⇒ Object
31 32 33 |
# File 'lib/capital_on_tap/configuration.rb', line 31 def base_auth_url AUTH_DOMAINS[@env.to_sym] || AUTH_DOMAINS[:development] end |
#base_url ⇒ Object
35 36 37 |
# File 'lib/capital_on_tap/configuration.rb', line 35 def base_url API_DOMAINS[@env.to_sym] || API_DOMAINS[:development] end |
#debug? ⇒ Boolean
27 28 29 |
# File 'lib/capital_on_tap/configuration.rb', line 27 def debug? @debug end |