Module: EzpayInvoice::Configurable
- Included in:
- EzpayInvoice, Client
- Defined in:
- lib/ezpay-invoice/configurable.rb
Constant Summary collapse
- MODES =
['dev', 'prod']
Instance Attribute Summary collapse
-
#hash_iv ⇒ Object
Returns the value of attribute hash_iv.
-
#hash_key ⇒ Object
Returns the value of attribute hash_key.
-
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#hash_iv ⇒ Object
Returns the value of attribute hash_iv.
3 4 5 |
# File 'lib/ezpay-invoice/configurable.rb', line 3 def hash_iv @hash_iv end |
#hash_key ⇒ Object
Returns the value of attribute hash_key.
3 4 5 |
# File 'lib/ezpay-invoice/configurable.rb', line 3 def hash_key @hash_key end |
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
3 4 5 |
# File 'lib/ezpay-invoice/configurable.rb', line 3 def merchant_id @merchant_id end |
Class Method Details
.attributes ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/ezpay-invoice/configurable.rb', line 25 def attributes @attributes ||= [ :merchant_id, :hash_key, :hash_iv, :mode ] end |
Instance Method Details
#config ⇒ Object
20 21 22 |
# File 'lib/ezpay-invoice/configurable.rb', line 20 def config self end |
#mode ⇒ Object
7 8 9 |
# File 'lib/ezpay-invoice/configurable.rb', line 7 def mode @mode ||= 'dev' end |
#mode=(_mode) ⇒ Object
11 12 13 14 |
# File 'lib/ezpay-invoice/configurable.rb', line 11 def mode=(_mode) raise ArgumentError, "mode must be one of [#{MODES.join(', ')}]." if !MODES.include?(_mode) @mode = _mode end |
#setup ⇒ Object
16 17 18 |
# File 'lib/ezpay-invoice/configurable.rb', line 16 def setup block_given? ? yield(self) : self end |