Method: DecisionReview::PdfValidation::Configuration#connection

Defined in:
lib/decision_review/utilities/pdf_validation/configuration.rb

#connectionFaraday::Connection

Creates the a connection with parsing json and adding breakers functionality.

Returns:

  • (Faraday::Connection)

    a Faraday connection instance.



38
39
40
41
42
43
44
45
46
47
# File 'lib/decision_review/utilities/pdf_validation/configuration.rb', line 38

def connection
  @conn ||= Faraday.new(base_path, headers: base_request_headers, request: request_options) do |faraday|
    faraday.use      :breakers
    faraday.use      Faraday::Response::RaiseError

    faraday.response :betamocks if mock_enabled?
    faraday.response :json
    faraday.adapter Faraday.default_adapter
  end
end