Class: IntersoftAPI::ShipmentResource
- Defined in:
- lib/intersoft_api/resources/shipment.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #all(shipping_location_id, options = {}) ⇒ Object
- #create(attributes) ⇒ Object
- #generate_label_qr_code(shipment_id) ⇒ Object
Methods inherited from Resource
#get_request, #initialize, #post_request, #put_request
Constructor Details
This class inherits a constructor from IntersoftAPI::Resource
Instance Method Details
#all(shipping_location_id, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/intersoft_api/resources/shipment.rb', line 11 def all(shipping_location_id, = {}) url = "shipments/#{shipping_location_id}" = .slice(:shipping_account_id, :carrier_code, :status, :destination_country_code, :date_from, :date_to, :page_size, :page_number) = .transform_keys { |key| key.to_s.camelize(:lower) } url += "?#{.to_query}" if .any? Shipment.new(get_request(url).body) end |