Class: ForestAdminDatasourceMambuPayments::Configuration
- Inherits:
-
Object
- Object
- ForestAdminDatasourceMambuPayments::Configuration
- Defined in:
- lib/forest_admin_datasource_mambu_payments/configuration.rb
Constant Summary collapse
- DEFAULT_BASE_URL =
'https://api.numeral.io'.freeze
- SANDBOX_BASE_URL =
'https://api.sandbox.numeral.io'.freeze
- API_VERSION =
'v1'.freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#open_timeout ⇒ Object
readonly
Returns the value of attribute open_timeout.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(api_key:, base_url: nil, sandbox: false, open_timeout: 5, timeout: 30) ⇒ Configuration
constructor
A new instance of Configuration.
- #url ⇒ Object
Constructor Details
#initialize(api_key:, base_url: nil, sandbox: false, open_timeout: 5, timeout: 30) ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 |
# File 'lib/forest_admin_datasource_mambu_payments/configuration.rb', line 9 def initialize(api_key:, base_url: nil, sandbox: false, open_timeout: 5, timeout: 30) @api_key = api_key @base_url = base_url || (sandbox ? SANDBOX_BASE_URL : DEFAULT_BASE_URL) @open_timeout = open_timeout @timeout = timeout validate! end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/forest_admin_datasource_mambu_payments/configuration.rb', line 7 def api_key @api_key end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
7 8 9 |
# File 'lib/forest_admin_datasource_mambu_payments/configuration.rb', line 7 def base_url @base_url end |
#open_timeout ⇒ Object (readonly)
Returns the value of attribute open_timeout.
7 8 9 |
# File 'lib/forest_admin_datasource_mambu_payments/configuration.rb', line 7 def open_timeout @open_timeout end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
7 8 9 |
# File 'lib/forest_admin_datasource_mambu_payments/configuration.rb', line 7 def timeout @timeout end |
Instance Method Details
#url ⇒ Object
17 18 19 |
# File 'lib/forest_admin_datasource_mambu_payments/configuration.rb', line 17 def url "#{@base_url.chomp("/")}/#{API_VERSION}" end |