Class: VAProfile::Configuration
- Inherits:
-
Common::Client::Configuration::REST
- Object
- Common::Client::Configuration::Base
- Common::Client::Configuration::REST
- VAProfile::Configuration
- Defined in:
- lib/va_profile/configuration.rb
Direct Known Subclasses
AddressValidation::Configuration, VAProfile::Communication::Configuration, VAProfile::ContactInformation::Configuration, Demographics::Configuration, MilitaryPersonnel::Configuration, V2::ContactInformation::Configuration, V3::AddressValidation::Configuration, VeteranStatus::Configuration
Constant Summary collapse
- SETTINGS =
Settings.va_profile || Settings.vet360
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
Instance Method Summary collapse
Methods inherited from Common::Client::Configuration::Base
#base_path, #breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #current_module, #request_options, #service_exception, #service_name
Class Method Details
.base_request_headers ⇒ Object
10 11 12 |
# File 'lib/va_profile/configuration.rb', line 10 def self.base_request_headers super.merge('cufSystemName' => VAProfile::Models::Base::SOURCE_SYSTEM) end |
Instance Method Details
#connection ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/va_profile/configuration.rb', line 14 def connection @conn ||= Faraday.new(base_path, headers: base_request_headers, request: ) do |faraday| faraday.use :breakers faraday.use Faraday::Response::RaiseError faraday.response :snakecase, symbolize: false faraday.response :json, content_type: /\bjson/ # ensures only json content types parsed faraday.response :betamocks if mock_enabled? faraday.adapter Faraday.default_adapter end end |
#mock_enabled? ⇒ Boolean
26 27 28 |
# File 'lib/va_profile/configuration.rb', line 26 def mock_enabled? false end |