Class: SimpleShipping::Ups::ShipConfirmRequest

Inherits:
Request show all
Defined in:
lib/simple_shipping/ups/ship_confirm_request.rb

Overview

Request to verify a shipment was delivered.

Constant Summary

Constants inherited from Request

Request::REQUEST_OPTION

Instance Attribute Summary

Attributes inherited from Abstract::Request

#credentials, #type

Instance Method Summary collapse

Methods inherited from Request

#label_specification

Methods inherited from Abstract::Request

#response, #response_class

Constructor Details

#initialize(credentials, shipment, options = {}) ⇒ ShipConfirmRequest

Returns a new instance of ShipConfirmRequest.



4
5
6
7
8
9
# File 'lib/simple_shipping/ups/ship_confirm_request.rb', line 4

def initialize(credentials, shipment, options = {})
  @credentials = credentials
  @shipment    = shipment
  @options     = options
  @type        = :process_ship_confirm
end

Instance Method Details

#bodyObject

Builds a request from shipment object.



12
13
14
15
16
17
18
19
20
# File 'lib/simple_shipping/ups/ship_confirm_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