Sha256: ad89e2a4e43e59043bcc699c61879eed173c67301506053097bd77be2e2b453f

Contents?: true

Size: 454 Bytes

Versions: 8

Compression:

Stored size: 454 Bytes

Contents

require 'faraday_middleware/parse_oj'

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.response :oj, content_type: /\bjson$/ unless config.raw
        conn.adapter config.adapter
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
taric-1.0.0.pre.alpha.4 lib/taric/connection.rb
taric-1.0.0.pre.alpha.3 lib/taric/connection.rb
taric-1.0.0.pre.alpha.2 lib/taric/connection.rb
taric-1.0.0.pre.alpha.1 lib/taric/connection.rb
taric-1.0.0.pre.alpha lib/taric/connection.rb
taric-0.5.1 lib/taric/connection.rb
taric-0.5.0 lib/taric/connection.rb
taric-0.4.0 lib/taric/connection.rb