Class: AllinpayCnp::Config
- Inherits:
-
Object
- Object
- AllinpayCnp::Config
- Defined in:
- lib/allinpay_cnp/config.rb
Constant Summary collapse
- ENVIRONMENTS =
%i[test production].freeze
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#inst_no ⇒ Object
Returns the value of attribute inst_no.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
-
#private_key ⇒ Object
Returns the value of attribute private_key.
-
#public_key ⇒ Object
Returns the value of attribute public_key.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #production? ⇒ Boolean
- #test? ⇒ Boolean
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 13 |
# File 'lib/allinpay_cnp/config.rb', line 10 def initialize @environment = :test @timeout = 30 end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
8 9 10 |
# File 'lib/allinpay_cnp/config.rb', line 8 def environment @environment end |
#inst_no ⇒ Object
Returns the value of attribute inst_no.
7 8 9 |
# File 'lib/allinpay_cnp/config.rb', line 7 def inst_no @inst_no end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/allinpay_cnp/config.rb', line 7 def logger @logger end |
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
7 8 9 |
# File 'lib/allinpay_cnp/config.rb', line 7 def merchant_id @merchant_id end |
#private_key ⇒ Object
Returns the value of attribute private_key.
7 8 9 |
# File 'lib/allinpay_cnp/config.rb', line 7 def private_key @private_key end |
#public_key ⇒ Object
Returns the value of attribute public_key.
7 8 9 |
# File 'lib/allinpay_cnp/config.rb', line 7 def public_key @public_key end |
#timeout ⇒ Object
Returns the value of attribute timeout.
7 8 9 |
# File 'lib/allinpay_cnp/config.rb', line 7 def timeout @timeout end |
Instance Method Details
#production? ⇒ Boolean
26 27 28 |
# File 'lib/allinpay_cnp/config.rb', line 26 def production? @environment == :production end |
#test? ⇒ Boolean
22 23 24 |
# File 'lib/allinpay_cnp/config.rb', line 22 def test? @environment == :test end |