module Shippo::API::Operations::Rates

Public Instance Methods

rates(shipment_object_id, currency = nil, params = {}) click to toggle source
# File lib/shippo/api/operations/rates.rb, line 5
def rates(shipment_object_id, currency = nil, params = {})
  if !currency.nil?
    response = Shippo::API.get("#{url}/#{shipment_object_id}/rates/#{currency}/", params)
  else
    response = Shippo::API.get("#{url}/#{shipment_object_id}/rates/", params)
  end
  Shippo::Rate.from(response[:results])
end