Class: EVSS::DisabilityCompensationForm::NonBreakeredConfiguration

Inherits:
Configuration show all
Defined in:
lib/evss/disability_compensation_form/non_breakered_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

Methods inherited from Configuration

#base_path, #mock_enabled?, #service_name

Methods inherited from Configuration

#cert?, #client_cert, #client_key, #connection, #mock_enabled?, #root_ca, #ssl_options

Methods inherited from Common::Client::Configuration::Base

#base_path, #breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #request_options, #service_exception, #service_name

Instance Method Details

#set_evss_middlewares(faraday, snakecase: true) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/evss/disability_compensation_form/non_breakered_configuration.rb', line 8

def set_evss_middlewares(faraday, snakecase: true)
  # faraday.use      :breakers # DONT USE BREAKERS
  faraday.use      EVSS::ErrorMiddleware
  faraday.use      Faraday::Response::RaiseError
  faraday.response :betamocks if mock_enabled?
  faraday.response :snakecase, symbolize: false if snakecase
  # calls to EVSS returns non JSON responses for some scenarios that don't make it through VAAFI
  # content_type: /\bjson$/ ensures only json content types are attempted to be parsed.
  faraday.response :json, content_type: /\bjson$/
  faraday.use :immutable_headers
  faraday.adapter Faraday.default_adapter
end