Class: MastercardCoreSdk::Core::Configuration
- Inherits:
-
Object
- Object
- MastercardCoreSdk::Core::Configuration
- Defined in:
- lib/mastercard_core_sdk/core/configuration.rb
Overview
Represents a set of configuration settings.
Instance Attribute Summary collapse
-
#cert_file ⇒ Object
Client certificate file (for client certificate).
-
#default_headers ⇒ Object
Returns the value of attribute default_headers.
-
#format ⇒ Object
Returns the value of attribute format.
-
#key_file ⇒ Object
Client private key file (for client certificate).
-
#ssl_ca_cert ⇒ String
Set this to customize the certificate file to verify the peer.
-
#timeout ⇒ Object
The time limit for HTTP request in seconds.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#verify_ssl ⇒ true, false
TLS/SSL Set this to false to skip verifying SSL certificate when calling API from https server.
-
#verify_ssl_host ⇒ true, false
TLS/SSL setting Set this to false to skip verifying SSL host name.
Class Method Summary collapse
-
.default ⇒ Object
The default Configuration object.
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#initialize {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 48 def initialize @timeout = 0 @verify_ssl = true @verify_ssl_host = true @cert_file = nil @key_file = nil @format = "" @default_headers = {} yield(self) if block_given? end |
Instance Attribute Details
#cert_file ⇒ Object
Client certificate file (for client certificate)
40 41 42 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 40 def cert_file @cert_file end |
#default_headers ⇒ Object
Returns the value of attribute default_headers.
46 47 48 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 46 def default_headers @default_headers end |
#format ⇒ Object
Returns the value of attribute format.
46 47 48 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 46 def format @format end |
#key_file ⇒ Object
Client private key file (for client certificate)
44 45 46 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 44 def key_file @key_file end |
#ssl_ca_cert ⇒ String
Set this to customize the certificate file to verify the peer.
github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
36 37 38 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 36 def ssl_ca_cert @ssl_ca_cert end |
#timeout ⇒ Object
The time limit for HTTP request in seconds. Default to 0 (never times out).
10 11 12 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 10 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
46 47 48 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 46 def user_agent @user_agent end |
#verify_ssl ⇒ true, false
Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. Since version 1.3.0, it is default to true.
TLS/SSL Set this to false to skip verifying SSL certificate when calling API from https server. Default to true.
19 20 21 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 19 def verify_ssl @verify_ssl end |
#verify_ssl_host ⇒ true, false
TLS/SSL setting Set this to false to skip verifying SSL host name. Default to true.
27 28 29 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 27 def verify_ssl_host @verify_ssl_host end |
Class Method Details
.default ⇒ Object
The default Configuration object.
61 62 63 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 61 def self.default @@default ||= Configuration.new end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
65 66 67 |
# File 'lib/mastercard_core_sdk/core/configuration.rb', line 65 def configure yield(self) if block_given? end |