Class: GmoPayment::Client::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/gmo_payment/client/options.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Options

Returns a new instance of Options.

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :api_endpoint (String)
  • :proxy (String)
  • :verify_mode (Integer)


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_endpointString

GMO API endpoint

Returns:

  • (String)


19
20
21
# File 'lib/gmo_payment/client/options.rb', line 19

def api_endpoint
  @api_endpoint ||= ENV['GMO_API_ENDPOINT']
end

#proxyURI::Generic, URI::HTTP

Proxy URI

Returns:

  • (URI::Generic, URI::HTTP)


26
27
28
# File 'lib/gmo_payment/client/options.rb', line 26

def proxy
  ::URI.parse(@proxy.to_s)
end

#verify_modeInteger

SSL/TLS verify mode (VERIFY_PEER or VERIFY_NONE). Defaults to: 1 (VERIFY_PEER).

Returns:

  • (Integer)


34
35
36
# File 'lib/gmo_payment/client/options.rb', line 34

def verify_mode
  @verify_mode ||= ::OpenSSL::SSL::VERIFY_PEER
end