Class: SimpleShipping::Ups::ShipmentRequest
- Inherits:
-
Request
- Object
- Abstract::Request
- Request
- SimpleShipping::Ups::ShipmentRequest
- Defined in:
- lib/simple_shipping/ups/shipment_request.rb
Overview
Shipment request model.
Constant Summary
Constants inherited from Request
Instance Attribute Summary
Attributes inherited from Abstract::Request
Instance Method Summary collapse
-
#body ⇒ Object
Builds a request from shipment object.
-
#initialize(credentials, shipment, options = {}) ⇒ ShipmentRequest
constructor
A new instance of ShipmentRequest.
Methods inherited from Request
Methods inherited from Abstract::Request
Constructor Details
#initialize(credentials, shipment, options = {}) ⇒ ShipmentRequest
Returns a new instance of ShipmentRequest.
4 5 6 7 8 9 |
# File 'lib/simple_shipping/ups/shipment_request.rb', line 4 def initialize(credentials, shipment, = {}) @credentials = credentials @shipment = shipment @options = @type = :process_shipment end |
Instance Method Details
#body ⇒ Object
Builds a request from shipment object.
12 13 14 15 16 17 18 19 20 |
# File 'lib/simple_shipping/ups/shipment_request.rb', line 12 def body { 'common:Request' => { 'common:RequestOption' => REQUEST_OPTION }, 'Shipment' => ShipmentBuilder.build(@shipment, @options), 'LabelSpecification' => label_specification, :order! => ['common:Request', 'Shipment', 'LabelSpecification'] } end |