Class: Youlend::Configuration
- Inherits:
-
Object
- Object
- Youlend::Configuration
- Defined in:
- lib/youlend/configuration.rb
Constant Summary collapse
- DOMAINS =
{ production: 'https://youlendapi.com', development: 'https://staging.youlendapi.com' }.freeze
- API_DOMAINS =
{ production: 'https://youlendapi.com', development: 'https://partners.staging-youlendapi.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.
-
#tokens ⇒ Object
Returns the value of attribute tokens.
Instance Method Summary collapse
- #api_domain ⇒ Object
- #debug? ⇒ Boolean
- #domain ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 |
# File 'lib/youlend/configuration.rb', line 18 def initialize @tokens = { onboarding: '', prequalification: '' } @webhook_signature = '' @env = defined?(::Rails) ? ::Rails.env.to_sym : :development @debug = false end |
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/youlend/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/youlend/configuration.rb', line 5 def client_secret @client_secret end |
#debug=(value) ⇒ Object (writeonly)
Sets the attribute debug
6 7 8 |
# File 'lib/youlend/configuration.rb', line 6 def debug=(value) @debug = value end |
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/youlend/configuration.rb', line 5 def env @env end |
#tokens ⇒ Object
Returns the value of attribute tokens.
5 6 7 |
# File 'lib/youlend/configuration.rb', line 5 def tokens @tokens end |
Instance Method Details
#api_domain ⇒ Object
29 30 31 |
# File 'lib/youlend/configuration.rb', line 29 def api_domain API_DOMAINS[@env.to_sym] || API_DOMAINS[:development] end |
#debug? ⇒ Boolean
25 26 27 |
# File 'lib/youlend/configuration.rb', line 25 def debug? @debug end |