Class: Preneeds::Configuration
- Inherits:
-
Common::Client::Configuration::SOAP
- Object
- Common::Client::Configuration::Base
- Common::Client::Configuration::SOAP
- Preneeds::Configuration
- Defined in:
- lib/preneeds/configuration.rb
Overview
Configuration for the Service to communicate to set the base path, a default timeout, and a service name for breakers and metrics. Communicates with the EOAS external service.
Constant Summary collapse
- TIMEOUT =
Number of seconds before timeout
30
Instance Attribute Summary
Attributes inherited from Common::Client::Configuration::Base
#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent
Class Method Summary collapse
-
.url ⇒ String
The base path for the external EOAS service.
Instance Method Summary collapse
-
#base_path ⇒ String
The base path for the external EOAS service.
-
#connection ⇒ Faraday::Connection
Creates the a connection with middleware for mapping errors, parsing XML, and adding breakers functionality.
-
#service_name ⇒ String
The name of the service, used by breakers to set a metric name for the service.
Methods inherited from Common::Client::Configuration::SOAP
#allow_missing_certs?, #ssl_cert, #ssl_key
Methods inherited from Common::Client::Configuration::Base
#breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #current_module, #request_options, #service_exception
Class Method Details
.url ⇒ String
Returns The base path for the external EOAS service.
22 23 24 |
# File 'lib/preneeds/configuration.rb', line 22 def self.url "#{Settings.preneeds.host}/eoas_SOA/PreNeedApplicationPort" end |
Instance Method Details
#base_path ⇒ String
Returns The base path for the external EOAS service.
28 29 30 |
# File 'lib/preneeds/configuration.rb', line 28 def base_path self.class.url end |
#connection ⇒ Faraday::Connection
Creates the a connection with middleware for mapping errors, parsing XML, and adding breakers functionality.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/preneeds/configuration.rb', line 42 def connection path = Preneeds::Configuration.url @faraday ||= Faraday.new( path, headers: base_request_headers, request: , ssl: { verify: false } ) do |conn| conn.use :breakers conn..timeout = TIMEOUT conn.request :soap_headers conn.response :preneeds_parser conn.response :soap_parser conn.response :eoas_xml_errors conn.response :clean_response conn.adapter Faraday.default_adapter end end |
#service_name ⇒ String
Returns The name of the service, used by breakers to set a metric name for the service.
34 35 36 |
# File 'lib/preneeds/configuration.rb', line 34 def service_name 'Preneeds' end |