Sha256: 580c8ce89b0dcb181468aa42b371d6242fa5b712ac6c5614f50588ff8b613b1f

Contents?: true

Size: 477 Bytes

Versions: 2

Compression:

Stored size: 477 Bytes

Contents

require 'faraday_middleware'

module Taric
  module Connection
    def connection(config)
      options = {
          :headers => {'Accept' => "application/#{config.format}; charset=utf-8", 'User-Agent' => config.user_agent}
      }.merge(config.connection_opts)

      Faraday::Connection.new(options) do |conn|
        #conn.use FaradayMiddleware::Mashify
        conn.response :json, :content_type => /\bjson$/
        conn.adapter config.adapter
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
taric-0.1.2 lib/taric/connection.rb
taric-0.1.1 lib/taric/connection.rb