Class: PaygatePk::Config
- Inherits:
-
Object
- Object
- PaygatePk::Config
- Defined in:
- lib/paygate_pk/config.rb
Overview
Global configuration for PaygatePk
Defined Under Namespace
Classes: ProviderConfig
Instance Attribute Summary collapse
-
#default_currency ⇒ Object
Returns the value of attribute default_currency.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#pay_fast ⇒ Object
readonly
Returns the value of attribute pay_fast.
-
#retry ⇒ Object
Returns the value of attribute retry.
-
#timeouts ⇒ Object
Returns the value of attribute timeouts.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #freeze! ⇒ Object
- #frozen? ⇒ Boolean
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/paygate_pk/config.rb', line 9 def initialize @logger = nil @default_currency = "PKR" @timeouts = { open_timeout: 5, read_timeout: 10 } @retry = { max: 2, interval: 0.2, backoff_factor: 2.0, retry_statuses: [429, 500, 502, 503, 504] } @user_agent = "paygate_pk/#{PaygatePk::VERSION}" @pay_fast = ProviderConfig.new @frozen = false end |
Instance Attribute Details
#default_currency ⇒ Object
Returns the value of attribute default_currency.
6 7 8 |
# File 'lib/paygate_pk/config.rb', line 6 def default_currency @default_currency end |
#logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/paygate_pk/config.rb', line 6 def logger @logger end |
#pay_fast ⇒ Object (readonly)
Returns the value of attribute pay_fast.
7 8 9 |
# File 'lib/paygate_pk/config.rb', line 7 def pay_fast @pay_fast end |
#retry ⇒ Object
Returns the value of attribute retry.
6 7 8 |
# File 'lib/paygate_pk/config.rb', line 6 def retry @retry end |
#timeouts ⇒ Object
Returns the value of attribute timeouts.
6 7 8 |
# File 'lib/paygate_pk/config.rb', line 6 def timeouts @timeouts end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
6 7 8 |
# File 'lib/paygate_pk/config.rb', line 6 def user_agent @user_agent end |
Instance Method Details
#freeze! ⇒ Object
20 21 22 23 |
# File 'lib/paygate_pk/config.rb', line 20 def freeze! @frozen = true self end |
#frozen? ⇒ Boolean
25 26 27 |
# File 'lib/paygate_pk/config.rb', line 25 def frozen? @frozen end |