Class: Shipvine::OutboundShipment
- Defined in:
- lib/shipvine/outbound_shipment.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(shipment_hash) ⇒ OutboundShipment
constructor
A new instance of OutboundShipment.
- #merchant_identifier ⇒ Object
- #wfs_identifier ⇒ Object (also: #shipvine_identifier)
Methods inherited from Base
Constructor Details
#initialize(shipment_hash) ⇒ OutboundShipment
Returns a new instance of OutboundShipment.
15 16 17 |
# File 'lib/shipvine/outbound_shipment.rb', line 15 def initialize(shipment_hash) @attributes = shipment_hash end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
13 14 15 |
# File 'lib/shipvine/outbound_shipment.rb', line 13 def attributes @attributes end |
Class Method Details
.list(since) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/shipvine/outbound_shipment.rb', line 4 def self.list(since) request = self.client.request(:get, '/outbound-shipments', { 'created-since' => since }) response = self.xml_to_hash(request.body) Array.wrap(response[:outbound_shipments][:outbound_shipment]).map do |shipment_hash| self.new(shipment_hash) end end |
Instance Method Details
#merchant_identifier ⇒ Object
19 20 21 |
# File 'lib/shipvine/outbound_shipment.rb', line 19 def merchant_identifier @attributes[:fulfillment_request][:merchant_identifier] end |
#wfs_identifier ⇒ Object Also known as: shipvine_identifier
23 24 25 |
# File 'lib/shipvine/outbound_shipment.rb', line 23 def wfs_identifier @attributes[:fulfillment_request][:wfs_identifier] end |