Class: BipClaims::Configuration
- Inherits:
-
Common::Client::Configuration::REST
- Object
- Common::Client::Configuration::Base
- Common::Client::Configuration::REST
- BipClaims::Configuration
- Defined in:
- lib/bip_claims/configuration.rb
Instance Attribute Summary
Attributes inherited from Common::Client::Configuration::Base
#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent
Instance Method Summary collapse
- #base_path ⇒ Object
-
#connection ⇒ Faraday::Connection
Creates the a connection with middleware for mapping errors, parsing json, and adding breakers functionality.
-
#mock_enabled? ⇒ Boolean
Should the service use mock data in lower environments.
- #service_name ⇒ Object
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
Instance Method Details
#base_path ⇒ Object
5 6 7 |
# File 'lib/bip_claims/configuration.rb', line 5 def base_path Settings.bip.claims.url end |
#connection ⇒ Faraday::Connection
Creates the a connection with middleware for mapping errors, parsing json, and adding breakers functionality.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bip_claims/configuration.rb', line 18 def connection Faraday.new(base_path, headers: base_request_headers, request: ) do |faraday| faraday.use :breakers faraday.request :json faraday.response :raise_custom_error, error_prefix: service_name faraday.response :betamocks if mock_enabled? faraday.response :json faraday.adapter Faraday.default_adapter end end |
#mock_enabled? ⇒ Boolean
Returns Should the service use mock data in lower environments.
33 34 35 |
# File 'lib/bip_claims/configuration.rb', line 33 def mock_enabled? [true, 'true'].include?(Settings.bip.claims.mock) end |
#service_name ⇒ Object
9 10 11 |
# File 'lib/bip_claims/configuration.rb', line 9 def service_name 'BipClaims' end |