Class: Payoneer::Configuration
- Inherits:
-
Object
- Object
- Payoneer::Configuration
- Defined in:
- lib/payoneer/configuration.rb
Constant Summary collapse
- DEVELOPMENT_ENVIRONMENT =
'development'
- PRODUCTION_ENVIRONMENT =
'production'
- DEVELOPMENT_API_URL =
'https://api.sandbox.payoneer.com/Payouts/HttpApi/API.aspx?'
- PRODUCTION_API_URL =
'https://api.payoneer.com/Payouts/HttpApi/API.aspx?'
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
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 |
# File 'lib/payoneer/configuration.rb', line 10 def initialize @environment = DEVELOPMENT_ENVIRONMENT end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
8 9 10 |
# File 'lib/payoneer/configuration.rb', line 8 def environment @environment end |
#partner_api_password ⇒ Object
Returns the value of attribute partner_api_password.
8 9 10 |
# File 'lib/payoneer/configuration.rb', line 8 def partner_api_password @partner_api_password end |
#partner_id ⇒ Object
Returns the value of attribute partner_id.
8 9 10 |
# File 'lib/payoneer/configuration.rb', line 8 def partner_id @partner_id end |
#partner_username ⇒ Object
Returns the value of attribute partner_username.
8 9 10 |
# File 'lib/payoneer/configuration.rb', line 8 def partner_username @partner_username end |
Instance Method Details
#api_url ⇒ Object
14 15 16 |
# File 'lib/payoneer/configuration.rb', line 14 def api_url environment == PRODUCTION_ENVIRONMENT ? PRODUCTION_API_URL : DEVELOPMENT_API_URL end |
#validate! ⇒ Object
18 19 20 |
# File 'lib/payoneer/configuration.rb', line 18 def validate! fail Errors::ConfigurationError unless partner_id && partner_username && partner_api_password end |