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
-
#auto_approve_sandbox_accounts ⇒ Object
Returns the value of attribute auto_approve_sandbox_accounts.
-
#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
- #auto_approve_sandbox_accounts? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #production? ⇒ Boolean
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 |
# File 'lib/payoneer/configuration.rb', line 10 def initialize @environment = DEVELOPMENT_ENVIRONMENT @auto_approve_sandbox_accounts = false end |
Instance Attribute Details
#auto_approve_sandbox_accounts ⇒ Object
Returns the value of attribute auto_approve_sandbox_accounts.
8 9 10 |
# File 'lib/payoneer/configuration.rb', line 8 def auto_approve_sandbox_accounts @auto_approve_sandbox_accounts end |
#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
19 20 21 |
# File 'lib/payoneer/configuration.rb', line 19 def api_url production? ? PRODUCTION_API_URL : DEVELOPMENT_API_URL end |
#auto_approve_sandbox_accounts? ⇒ Boolean
23 24 25 |
# File 'lib/payoneer/configuration.rb', line 23 def auto_approve_sandbox_accounts? !production? && auto_approve_sandbox_accounts end |
#production? ⇒ Boolean
15 16 17 |
# File 'lib/payoneer/configuration.rb', line 15 def production? environment == PRODUCTION_ENVIRONMENT end |
#validate! ⇒ Object
27 28 29 |
# File 'lib/payoneer/configuration.rb', line 27 def validate! fail Errors::ConfigurationError unless partner_id && partner_username && partner_api_password end |