Class: PayPro::Config
- Inherits:
-
Object
- Object
- PayPro::Config
- Defined in:
- lib/pay_pro/config.rb
Overview
Config saves the configuration options
Constant Summary collapse
- DEFAULT_CA_BUNDLE_PATH =
File.join(__dir__, 'data/cacert.pem')
- DEFAULT_TIMEOUT =
30
- DEFAULT_VERIFY_SSL =
true
- ATTRIBUTES =
%i[api_key api_url ca_bundle_path timeout verify_ssl].freeze
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #merge(hash) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
14 15 16 17 18 19 20 |
# File 'lib/pay_pro/config.rb', line 14 def initialize @api_key = nil @api_url = API_URL @ca_bundle_path = DEFAULT_CA_BUNDLE_PATH @timeout = DEFAULT_TIMEOUT @verify_ssl = DEFAULT_VERIFY_SSL end |
Instance Method Details
#merge(hash) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/pay_pro/config.rb', line 22 def merge(hash) dup.tap do |instance| hash.slice(*ATTRIBUTES).each do |key, value| instance.public_send("#{key}=", value) end end end |