module Azimuth::Connection

Faraday connection methods

Private Instance Methods

connection() click to toggle source
# File lib/azimuth/connection.rb, line 9
def connection
  options = {
    ssl: { verify: false },
    url: self.api_endpoint,
  }

  connection = Faraday.new(options) do |conn|
    conn.response(:mashify)
    conn.response(:json, content_type: /\bjson$/)

    conn.use(Azimuth::Response::RaiseError)
    conn.use(FaradayMiddleware::FollowRedirects, limit: 3)

    conn.adapter(Faraday.default_adapter)
  end

  connection
end