Class: DJI::DHL::TrackingResults
- Inherits:
-
Object
- Object
- DJI::DHL::TrackingResults
- Defined in:
- lib/dji/dhl/tracking_results.rb
Instance Attribute Summary collapse
-
#shipments ⇒ Object
Returns the value of attribute shipments.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ TrackingResults
constructor
A new instance of TrackingResults.
Constructor Details
#initialize ⇒ TrackingResults
Returns a new instance of TrackingResults.
9 10 11 |
# File 'lib/dji/dhl/tracking_results.rb', line 9 def initialize @shipments = [] end |
Instance Attribute Details
#shipments ⇒ Object
Returns the value of attribute shipments.
7 8 9 |
# File 'lib/dji/dhl/tracking_results.rb', line 7 def shipments @shipments end |
Class Method Details
.new_from_results(results) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dji/dhl/tracking_results.rb', line 15 def new_from_results(results) return nil if results.blank? tr = TrackingResults.new results.each do |item| shipment = DJI::DHL::Shipment.new_from_item(item) tr.shipments << shipment end tr end |