Class: PayoneerApiClient::Configuration
- Inherits:
-
Object
- Object
- PayoneerApiClient::Configuration
- Defined in:
- lib/payoneer_api_client/configuration.rb
Constant Summary collapse
- DEVELOPMENT_ENVIRONMENT =
'development'
- PRODUCTION_ENVIRONMENT =
'production'
- DEVELOPMENT_API_URL =
'https://api.sandbox.payoneer.com/v2/programs'
- PRODUCTION_API_URL =
'https://api.payoneer.com/v2/programs'
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#partner_api_password ⇒ Object
Returns the value of attribute partner_api_password.
-
#partner_id ⇒ Object
Returns the value of attribute partner_id.
-
#partner_username ⇒ Object
Returns the value of attribute partner_username.
Instance Method Summary collapse
- #api_url ⇒ Object
- #create_url(url) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #production? ⇒ Boolean
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 |
# File 'lib/payoneer_api_client/configuration.rb', line 12 def initialize @environment = DEVELOPMENT_ENVIRONMENT end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
10 11 12 |
# File 'lib/payoneer_api_client/configuration.rb', line 10 def environment @environment end |
#partner_api_password ⇒ Object
Returns the value of attribute partner_api_password.
10 11 12 |
# File 'lib/payoneer_api_client/configuration.rb', line 10 def partner_api_password @partner_api_password end |
#partner_id ⇒ Object
Returns the value of attribute partner_id.
10 11 12 |
# File 'lib/payoneer_api_client/configuration.rb', line 10 def partner_id @partner_id end |
#partner_username ⇒ Object
Returns the value of attribute partner_username.
10 11 12 |
# File 'lib/payoneer_api_client/configuration.rb', line 10 def partner_username @partner_username end |
Instance Method Details
#api_url ⇒ Object
20 21 22 |
# File 'lib/payoneer_api_client/configuration.rb', line 20 def api_url create_url(production? ? PRODUCTION_API_URL : DEVELOPMENT_API_URL) end |
#create_url(url) ⇒ Object
24 25 26 |
# File 'lib/payoneer_api_client/configuration.rb', line 24 def create_url(url) "#{url}/#{partner_id}" end |
#production? ⇒ Boolean
16 17 18 |
# File 'lib/payoneer_api_client/configuration.rb', line 16 def production? environment == PRODUCTION_ENVIRONMENT end |
#validate! ⇒ Object
28 29 30 |
# File 'lib/payoneer_api_client/configuration.rb', line 28 def validate! raise Errors::ConfigurationError unless partner_id && partner_username && partner_api_password end |