Class: TrueTrial::Resources::Shipments
- Inherits:
-
Object
- Object
- TrueTrial::Resources::Shipments
- Defined in:
- lib/truetrial/resources/shipments.rb
Overview
Provides access to shipment-related API endpoints.
Instance Method Summary collapse
-
#create(order_id, data) ⇒ Hash
Creates a shipment for an order.
-
#initialize(http_client) ⇒ Shipments
constructor
A new instance of Shipments.
-
#list(order_id) ⇒ Hash
Lists all shipments for an order.
Constructor Details
#initialize(http_client) ⇒ Shipments
Returns a new instance of Shipments.
7 8 9 |
# File 'lib/truetrial/resources/shipments.rb', line 7 def initialize(http_client) @http = http_client end |
Instance Method Details
#create(order_id, data) ⇒ Hash
Creates a shipment for an order.
16 17 18 |
# File 'lib/truetrial/resources/shipments.rb', line 16 def create(order_id, data) @http.post("/orders/#{order_id}/shipments", body: data) end |
#list(order_id) ⇒ Hash
Lists all shipments for an order.
24 25 26 |
# File 'lib/truetrial/resources/shipments.rb', line 24 def list(order_id) @http.get("/orders/#{order_id}/shipments") end |