Class: Post911SOB::DGIB::Configuration
- Inherits:
-
Common::Client::Configuration::REST
- Object
- Common::Client::Configuration::Base
- Common::Client::Configuration::REST
- Post911SOB::DGIB::Configuration
- Defined in:
- lib/post911_sob/dgib/configuration.rb
Constant Summary collapse
- SETTINGS =
Settings.dgi.post911_sob.claimants
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
TO-DO: Datadog.
- #connection ⇒ Object
- #mock_enabled? ⇒ Boolean private
- #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
TO-DO: Datadog
12 13 14 |
# File 'lib/post911_sob/dgib/configuration.rb', line 12 def base_path SETTINGS.url.to_s end |
#connection ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/post911_sob/dgib/configuration.rb', line 20 def connection @conn ||= Faraday.new(base_path, headers: base_request_headers, request: ) do |faraday| faraday.use :breakers faraday.use Faraday::Response::RaiseError faraday.request :json faraday.response :betamocks if mock_enabled? faraday.response :snakecase, symbolize: false faraday.response :json, content_type: /\bjson/ # ensures only json content types parsed faraday.adapter Faraday.default_adapter end end |
#mock_enabled? ⇒ Boolean (private)
35 36 37 |
# File 'lib/post911_sob/dgib/configuration.rb', line 35 def mock_enabled? SETTINGS.mock || false end |
#service_name ⇒ Object
16 17 18 |
# File 'lib/post911_sob/dgib/configuration.rb', line 16 def service_name 'Post911SOB/DGIB' end |