Class: BID::Configuration
- Inherits:
-
Common::Client::Configuration::REST
- Object
- Common::Client::Configuration::Base
- Common::Client::Configuration::REST
- BID::Configuration
- Defined in:
- lib/bid/configuration.rb
Direct Known Subclasses
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 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
Instance Method Details
#connection ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/bid/configuration.rb', line 7 def connection @conn ||= Faraday.new(base_path, headers: base_request_headers, request: ) do |faraday| faraday.use :breakers faraday.use Faraday::Response::RaiseError faraday.response :betamocks if mock_enabled? faraday.response :snakecase, symbolize: false faraday.response :json, content_type: /\bjson/ faraday.adapter Faraday.default_adapter end end |
#mock_enabled? ⇒ Boolean
18 19 20 21 |
# File 'lib/bid/configuration.rb', line 18 def mock_enabled? # subclass to override false end |