Class: MPI::Configuration
Instance Attribute Summary
#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent
Class Method Summary
collapse
Instance Method Summary
collapse
#allow_missing_certs?, #ssl_cert, #ssl_key
#breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #current_module, #request_options, #service_exception
Class Method Details
.open_timeout ⇒ Object
8
9
10
|
# File 'lib/mpi/configuration.rb', line 8
def self.open_timeout
Settings.mvi.open_timeout
end
|
.read_timeout ⇒ Object
12
13
14
|
# File 'lib/mpi/configuration.rb', line 12
def self.read_timeout
Settings.mvi.timeout
end
|
.ssl_cert_path ⇒ Object
16
17
18
|
# File 'lib/mpi/configuration.rb', line 16
def self.ssl_cert_path
Settings.mvi.client_cert_path
end
|
.ssl_key_path ⇒ Object
20
21
22
|
# File 'lib/mpi/configuration.rb', line 20
def self.ssl_key_path
Settings.mvi.client_key_path
end
|
Instance Method Details
#base_path ⇒ Object
24
25
26
|
# File 'lib/mpi/configuration.rb', line 24
def base_path
Settings.mvi.url
end
|
#connection ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/mpi/configuration.rb', line 41
def connection
Faraday.new(base_path, headers: , request: request_options, ssl: ssl_options) do |conn|
conn.use :breakers
conn.request :soap_headers
conn.response :soap_parser
conn.use :logging, 'MVIRequest' if Settings.mvi.pii_logging conn.response :betamocks if Settings.mvi.mock
conn.adapter Faraday.default_adapter
end
end
|
#service_name ⇒ Object
28
29
30
|
# File 'lib/mpi/configuration.rb', line 28
def service_name
'MVI'
end
|
#ssl_options ⇒ Object
32
33
34
35
36
37
38
39
|
# File 'lib/mpi/configuration.rb', line 32
def ssl_options
if ssl_cert && ssl_key
{
client_cert: ssl_cert,
client_key: ssl_key
}
end
end
|