Sha256: 805b4c5c5aaceb487075cccfa42ee04ee30f8d67f894706eafaefa98238a56e9

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 Bytes

Contents

require 'faraday'
require 'openamplify/response/raise_client_error'
require 'openamplify/response/raise_server_error'

module OpenAmplify
  module Connection

    private

    def connection(options)
      default_options = {
        :url => options.fetch(:endpoint, endpoint)
      }

      @connection ||= Faraday.new(default_options) do |builder|
        builder.use OpenAmplify::Response::RaiseClientError
        builder.use OpenAmplify::Response::RaiseServerError

        # TODO: Make logging optional
        # builder.response :logger

        builder.adapter adapter
      end
    end

  end # Connection

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openamplify-0.3.0 lib/openamplify/connection.rb