Class: GmoPayment::Client::Options
- Inherits:
-
Object
- Object
- GmoPayment::Client::Options
- Defined in:
- lib/gmo_payment/client/options.rb
Instance Method Summary collapse
-
#api_endpoint ⇒ String
GMO API endpoint.
-
#initialize(opts = {}) ⇒ Options
constructor
A new instance of Options.
-
#proxy ⇒ URI::Generic, URI::HTTP
Proxy URI.
-
#verify_mode ⇒ Integer
SSL/TLS verify mode (VERIFY_PEER or VERIFY_NONE).
Constructor Details
#initialize(opts = {}) ⇒ Options
Returns a new instance of Options.
10 11 12 13 14 |
# File 'lib/gmo_payment/client/options.rb', line 10 def initialize(opts = {}) [:api_endpoint, :proxy, :verify_mode].each do |item| instance_variable_set(:"@#{item}", opts[item] || GmoPayment::Configure.__send__(item)) end end |
Instance Method Details
#api_endpoint ⇒ String
GMO API endpoint
19 20 21 |
# File 'lib/gmo_payment/client/options.rb', line 19 def api_endpoint @api_endpoint ||= ENV['GMO_API_ENDPOINT'] end |
#proxy ⇒ URI::Generic, URI::HTTP
Proxy URI
26 27 28 |
# File 'lib/gmo_payment/client/options.rb', line 26 def proxy ::URI.parse(@proxy.to_s) end |
#verify_mode ⇒ Integer
SSL/TLS verify mode (VERIFY_PEER or VERIFY_NONE). Defaults to: 1 (VERIFY_PEER).
34 35 36 |
# File 'lib/gmo_payment/client/options.rb', line 34 def verify_mode @verify_mode ||= ::OpenSSL::SSL::VERIFY_PEER end |