Sha256: 6d55b3806441bfe6dcd5c2dac70e2ec9185ba3c9c68f754237a389de91d5aa8e

Contents?: true

Size: 525 Bytes

Versions: 11

Compression:

Stored size: 525 Bytes

Contents

module MtGox
  module Request
    def get(path, options={})
      request(:get, path, options)
    end

    def post(path, options={})
      request(:post, path, options)
    end

    private

    def request(method, path, options)
      response = connection.send(method) do |request|
        case method
        when :get
          request.url(path, options)
        when :post
          request.path = path
          request.body = options unless options.empty?
        end
      end
      response.body
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mtgox-0.7.1 lib/mtgox/request.rb
mtgox-0.7.0 lib/mtgox/request.rb
mtgox-0.6.0 lib/mtgox/request.rb
mtgox-0.5.1 lib/mtgox/request.rb
mtgox-0.5.0 lib/mtgox/request.rb
mtgox-0.4.1 lib/mtgox/request.rb
mtgox-0.4.0 lib/mtgox/request.rb
mtgox-0.3.1 lib/mtgox/request.rb
mtgox-0.3.0 lib/mtgox/request.rb
mtgox-0.2.0 lib/mtgox/request.rb
mtgox-0.1.0 lib/mtgox/request.rb