Class: SimpleShipping::Fedex::Request
- Inherits:
-
Abstract::Request
- Object
- Abstract::Request
- SimpleShipping::Fedex::Request
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/simple_shipping/fedex/request.rb
Overview
Builds a complete request for the FedEx service.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Abstract::Request
Instance Method Summary collapse
-
#body(opts = {}) ⇒ Object
Build a complete request from a shipment object.
-
#initialize(credentials, shipment) ⇒ Request
constructor
A new instance of Request.
Methods inherited from Abstract::Request
Constructor Details
#initialize(credentials, shipment) ⇒ Request
Returns a new instance of Request.
8 9 10 11 |
# File 'lib/simple_shipping/fedex/request.rb', line 8 def initialize(credentials, shipment) super(credentials) @shipment = shipment end |
Instance Method Details
#body(opts = {}) ⇒ Object
Build a complete request from a shipment object.
14 15 16 17 18 19 20 |
# File 'lib/simple_shipping/fedex/request.rb', line 14 def body(opts = {}) {'WebAuthenticationDetail' => web_authentication_detail, 'ClientDetail' => client_detail, 'Version' => version, 'RequestedShipment' => ShipmentBuilder.build(@shipment, opts), :order! => ['WebAuthenticationDetail', 'ClientDetail', 'Version', 'RequestedShipment'] } end |