Class: Shipping::UPS::Http

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/ups_shipping.rb

Instance Method Summary collapse

Constructor Details

#initialize(access_request, options = {}) ⇒ Http

Returns a new instance of Http.



21
22
23
24
25
26
27
# File 'lib/ups_shipping.rb', line 21

def initialize(access_request, options={})
  @access_request = access_request

  if (options[:test])
    self.class.base_uri TEST_URL
  end
end

Instance Method Details

#commit(url, request) ⇒ Object



29
30
31
32
# File 'lib/ups_shipping.rb', line 29

def commit(url, request)
  request = @access_request + request
  self.class.post(url, :body => request).parsed_response
end