Class: DJI::Fedex::Package
- Inherits:
-
Object
- Object
- DJI::Fedex::Package
- Defined in:
- lib/dji/fedex/package.rb
Instance Attribute Summary collapse
-
#delivery_date ⇒ Object
Returns the value of attribute delivery_date.
-
#dimensions ⇒ Object
Returns the value of attribute dimensions.
-
#estimated_delivery_date ⇒ Object
Returns the value of attribute estimated_delivery_date.
-
#key_status ⇒ Object
Returns the value of attribute key_status.
-
#key_status_code ⇒ Object
Returns the value of attribute key_status_code.
-
#last_scan_date_time ⇒ Object
Returns the value of attribute last_scan_date_time.
-
#last_scan_status ⇒ Object
Returns the value of attribute last_scan_status.
-
#main_status ⇒ Object
Returns the value of attribute main_status.
-
#pickup_date ⇒ Object
Returns the value of attribute pickup_date.
-
#pretty_tracking_number ⇒ Object
Returns the value of attribute pretty_tracking_number.
-
#received_by ⇒ Object
Returns the value of attribute received_by.
-
#recipient_address ⇒ Object
Returns the value of attribute recipient_address.
-
#recipient_address_line_2 ⇒ Object
Returns the value of attribute recipient_address_line_2.
-
#recipient_city ⇒ Object
Returns the value of attribute recipient_city.
-
#recipient_company_name ⇒ Object
Returns the value of attribute recipient_company_name.
-
#recipient_country_code ⇒ Object
Returns the value of attribute recipient_country_code.
-
#recipient_name ⇒ Object
Returns the value of attribute recipient_name.
-
#recipient_phone_number ⇒ Object
Returns the value of attribute recipient_phone_number.
-
#recipient_postal_code ⇒ Object
Returns the value of attribute recipient_postal_code.
-
#recipient_region_code ⇒ Object
Returns the value of attribute recipient_region_code.
-
#scan_events ⇒ Object
Returns the value of attribute scan_events.
-
#ship_date ⇒ Object
Returns the value of attribute ship_date.
-
#shipped_by ⇒ Object
Returns the value of attribute shipped_by.
-
#shipped_to ⇒ Object
Returns the value of attribute shipped_to.
-
#shipper_address ⇒ Object
Returns the value of attribute shipper_address.
-
#shipper_address_line_2 ⇒ Object
Returns the value of attribute shipper_address_line_2.
-
#shipper_city ⇒ Object
Returns the value of attribute shipper_city.
-
#shipper_company_name ⇒ Object
Returns the value of attribute shipper_company_name.
-
#shipper_country_code ⇒ Object
Returns the value of attribute shipper_country_code.
-
#shipper_name ⇒ Object
Returns the value of attribute shipper_name.
-
#shipper_phone_number ⇒ Object
Returns the value of attribute shipper_phone_number.
-
#shipper_postal_code ⇒ Object
Returns the value of attribute shipper_postal_code.
-
#shipper_region_code ⇒ Object
Returns the value of attribute shipper_region_code.
-
#sub_status ⇒ Object
Returns the value of attribute sub_status.
-
#tendered_date ⇒ Object
Returns the value of attribute tendered_date.
-
#total_weight ⇒ Object
Returns the value of attribute total_weight.
-
#tracking_carrier_code ⇒ Object
Returns the value of attribute tracking_carrier_code.
-
#tracking_carrier_description ⇒ Object
Returns the value of attribute tracking_carrier_description.
-
#tracking_number ⇒ Object
Returns the value of attribute tracking_number.
-
#tracking_qualifier ⇒ Object
Returns the value of attribute tracking_qualifier.
Class Method Summary collapse
Instance Method Summary collapse
- #destination ⇒ Object
-
#initialize ⇒ Package
constructor
A new instance of Package.
- #origin ⇒ Object
Constructor Details
#initialize ⇒ Package
Returns a new instance of Package.
20 21 22 |
# File 'lib/dji/fedex/package.rb', line 20 def initialize @scan_events = [] end |
Instance Attribute Details
#delivery_date ⇒ Object
Returns the value of attribute delivery_date.
16 17 18 |
# File 'lib/dji/fedex/package.rb', line 16 def delivery_date @delivery_date end |
#dimensions ⇒ Object
Returns the value of attribute dimensions.
17 18 19 |
# File 'lib/dji/fedex/package.rb', line 17 def dimensions @dimensions end |
#estimated_delivery_date ⇒ Object
Returns the value of attribute estimated_delivery_date.
16 17 18 |
# File 'lib/dji/fedex/package.rb', line 16 def estimated_delivery_date @estimated_delivery_date end |
#key_status ⇒ Object
Returns the value of attribute key_status.
14 15 16 |
# File 'lib/dji/fedex/package.rb', line 14 def key_status @key_status end |
#key_status_code ⇒ Object
Returns the value of attribute key_status_code.
14 15 16 |
# File 'lib/dji/fedex/package.rb', line 14 def key_status_code @key_status_code end |
#last_scan_date_time ⇒ Object
Returns the value of attribute last_scan_date_time.
14 15 16 |
# File 'lib/dji/fedex/package.rb', line 14 def last_scan_date_time @last_scan_date_time end |
#last_scan_status ⇒ Object
Returns the value of attribute last_scan_status.
14 15 16 |
# File 'lib/dji/fedex/package.rb', line 14 def last_scan_status @last_scan_status end |
#main_status ⇒ Object
Returns the value of attribute main_status.
15 16 17 |
# File 'lib/dji/fedex/package.rb', line 15 def main_status @main_status end |
#pickup_date ⇒ Object
Returns the value of attribute pickup_date.
16 17 18 |
# File 'lib/dji/fedex/package.rb', line 16 def pickup_date @pickup_date end |
#pretty_tracking_number ⇒ Object
Returns the value of attribute pretty_tracking_number.
6 7 8 |
# File 'lib/dji/fedex/package.rb', line 6 def pretty_tracking_number @pretty_tracking_number end |
#received_by ⇒ Object
Returns the value of attribute received_by.
15 16 17 |
# File 'lib/dji/fedex/package.rb', line 15 def received_by @received_by end |
#recipient_address ⇒ Object
Returns the value of attribute recipient_address.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_address @recipient_address end |
#recipient_address_line_2 ⇒ Object
Returns the value of attribute recipient_address_line_2.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_address_line_2 @recipient_address_line_2 end |
#recipient_city ⇒ Object
Returns the value of attribute recipient_city.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_city @recipient_city end |
#recipient_company_name ⇒ Object
Returns the value of attribute recipient_company_name.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_company_name @recipient_company_name end |
#recipient_country_code ⇒ Object
Returns the value of attribute recipient_country_code.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_country_code @recipient_country_code end |
#recipient_name ⇒ Object
Returns the value of attribute recipient_name.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_name @recipient_name end |
#recipient_phone_number ⇒ Object
Returns the value of attribute recipient_phone_number.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_phone_number @recipient_phone_number end |
#recipient_postal_code ⇒ Object
Returns the value of attribute recipient_postal_code.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_postal_code @recipient_postal_code end |
#recipient_region_code ⇒ Object
Returns the value of attribute recipient_region_code.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def recipient_region_code @recipient_region_code end |
#scan_events ⇒ Object
Returns the value of attribute scan_events.
18 19 20 |
# File 'lib/dji/fedex/package.rb', line 18 def scan_events @scan_events end |
#ship_date ⇒ Object
Returns the value of attribute ship_date.
16 17 18 |
# File 'lib/dji/fedex/package.rb', line 16 def ship_date @ship_date end |
#shipped_by ⇒ Object
Returns the value of attribute shipped_by.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipped_by @shipped_by end |
#shipped_to ⇒ Object
Returns the value of attribute shipped_to.
11 12 13 |
# File 'lib/dji/fedex/package.rb', line 11 def shipped_to @shipped_to end |
#shipper_address ⇒ Object
Returns the value of attribute shipper_address.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_address @shipper_address end |
#shipper_address_line_2 ⇒ Object
Returns the value of attribute shipper_address_line_2.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_address_line_2 @shipper_address_line_2 end |
#shipper_city ⇒ Object
Returns the value of attribute shipper_city.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_city @shipper_city end |
#shipper_company_name ⇒ Object
Returns the value of attribute shipper_company_name.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_company_name @shipper_company_name end |
#shipper_country_code ⇒ Object
Returns the value of attribute shipper_country_code.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_country_code @shipper_country_code end |
#shipper_name ⇒ Object
Returns the value of attribute shipper_name.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_name @shipper_name end |
#shipper_phone_number ⇒ Object
Returns the value of attribute shipper_phone_number.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_phone_number @shipper_phone_number end |
#shipper_postal_code ⇒ Object
Returns the value of attribute shipper_postal_code.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_postal_code @shipper_postal_code end |
#shipper_region_code ⇒ Object
Returns the value of attribute shipper_region_code.
8 9 10 |
# File 'lib/dji/fedex/package.rb', line 8 def shipper_region_code @shipper_region_code end |
#sub_status ⇒ Object
Returns the value of attribute sub_status.
15 16 17 |
# File 'lib/dji/fedex/package.rb', line 15 def sub_status @sub_status end |
#tendered_date ⇒ Object
Returns the value of attribute tendered_date.
16 17 18 |
# File 'lib/dji/fedex/package.rb', line 16 def tendered_date @tendered_date end |
#total_weight ⇒ Object
Returns the value of attribute total_weight.
17 18 19 |
# File 'lib/dji/fedex/package.rb', line 17 def total_weight @total_weight end |
#tracking_carrier_code ⇒ Object
Returns the value of attribute tracking_carrier_code.
7 8 9 |
# File 'lib/dji/fedex/package.rb', line 7 def tracking_carrier_code @tracking_carrier_code end |
#tracking_carrier_description ⇒ Object
Returns the value of attribute tracking_carrier_description.
7 8 9 |
# File 'lib/dji/fedex/package.rb', line 7 def tracking_carrier_description @tracking_carrier_description end |
#tracking_number ⇒ Object
Returns the value of attribute tracking_number.
6 7 8 |
# File 'lib/dji/fedex/package.rb', line 6 def tracking_number @tracking_number end |
#tracking_qualifier ⇒ Object
Returns the value of attribute tracking_qualifier.
7 8 9 |
# File 'lib/dji/fedex/package.rb', line 7 def tracking_qualifier @tracking_qualifier end |
Class Method Details
.new_from_response_package_item(item) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/dji/fedex/package.rb', line 36 def new_from_response_package_item(item) package = Package.new package.tracking_number = item['trackingNbr'] package.pretty_tracking_number = item['displayTrackingNbr'] package.tracking_qualifier = item['trackingQualifier'] package.tracking_carrier_code = item['trackingCarrierCd'] package.tracking_carrier_description = item['trackingCarrierDesc'] package.shipper_company_name = item['shipperCmpnyName'] package.shipper_name = item['shipperName'] package.shipper_address = item['shipperAddr1'] package.shipper_address_line_2 = item['shipperAddr2'] package.shipper_city = item['shipperCity'] package.shipper_region_code = item['shipperStateCD'] package.shipper_postal_code = item['shipperZip'] package.shipper_country_code = item['shipperCntryCD'] package.shipper_phone_number = item['shipperPhoneNbr'] package.shipped_by = item['shippedBy'] package.recipient_company_name = item['recipientCmpnyName'] package.recipient_name = item['recipientName'] package.recipient_address = item['recipientAddr1'] package.recipient_address_line_2 = item['recipientAddr2'] package.recipient_city = item['recipientCity'] package.recipient_region_code = item['recipientStateCD'] package.recipient_postal_code = item['recipientZip'] package.recipient_country_code = item['recipientCntryCD'] package.recipient_phone_number = item['recipientPhoneNbr'] package.shipped_to = item['shippedTo'] package.key_status = item['keyStatus'] package.key_status_code = item['keyStatusCD'] package.last_scan_status = item['lastScanStatus'] package.last_scan_date_time = item['lastScanDateTime'] package.received_by = item['receivedByNm'] package.sub_status = item['subStatus'] package.main_status = item['mainStatus'] package.tendered_date = Time.iso8601(item['tenderedDt']) if item['tenderedDt'].present? package.pickup_date = Time.iso8601(item['pickupDt']) if item['pickupDt'].present? package.ship_date = Time.iso8601(item['shipDt']) if item['shipDt'].present? package.estimated_delivery_date = Time.iso8601(item['estDeliveryDt']) if item['estDeliveryDt'].present? package.delivery_date = Time.iso8601(item['actDeliveryDt']) if item['actDeliveryDt'].present? package.dimensions = item['dimensions'] package.total_weight = { pounds: item['totalLbsWgt'], kilograms: item['totalKgsWgt'] } package end |
Instance Method Details
#destination ⇒ Object
24 25 26 27 |
# File 'lib/dji/fedex/package.rb', line 24 def destination [recipient_company_name, recipient_name, recipient_address, recipient_address_line_2, recipient_city, recipient_region_code, recipient_country_code].reject(&:blank?).join(', ') end |
#origin ⇒ Object
29 30 31 32 |
# File 'lib/dji/fedex/package.rb', line 29 def origin [shipper_company_name, shipper_name, shipper_address, shipper_address_line_2, shipper_city, shipper_region_code, shipper_country_code].reject(&:blank?).join(', ') end |