Sha256: cb71b8731143679fb3c8c520e0f18f4af5e2a60e0a790ee7accc988142032c79

Contents?: true

Size: 867 Bytes

Versions: 4

Compression:

Stored size: 867 Bytes

Contents

require 'faraday'
require 'faraday/request/url_encoded'
require 'faraday/response/raise_error'
require 'faraday/response/parse_json'
require 'faraday/response/raise_mtgox_error'
require 'faraday_middleware'
require 'mtgox/version'

module MtGox
  module Connection
    private

    def connection
      options = {
        :headers  => {
          :accept => 'application/json',
          :user_agent => "mt_gox gem #{MtGox::VERSION}",
        },
        :ssl => {:verify => false},
        :url => 'https://mtgox.com',
      }

      Faraday.new(options) do |connection|
        connection.use Faraday::Request::UrlEncoded
        connection.use Faraday::Response::RaiseError
        connection.use Faraday::Response::ParseJson
        connection.use Faraday::Response::RaiseMtGoxError
        connection.adapter(Faraday.default_adapter)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mt_gox-0.7.7 lib/mtgox/connection.rb
mt_gox-0.7.6 lib/mtgox/connection.rb
mt_gox-0.7.5 lib/mtgox/connection.rb
mt_gox-0.7.3 lib/mtgox/connection.rb