Class: FedexShip::TrackingInformation
- Inherits:
-
Object
- Object
- FedexShip::TrackingInformation
- Defined in:
- lib/fedex_ship/tracking_information.rb,
lib/fedex_ship/tracking_information/event.rb
Defined Under Namespace
Classes: Event
Constant Summary collapse
- PACKAGE_IDENTIFIER_TYPES =
%w{ BILL_OF_LADING COD_RETURN_TRACKING_NUMBER CUSTOMER_AUTHORIZATION_NUMBER CUSTOMER_REFERENCE DEPARTMENT FREE_FORM_REFERENCE GROUND_INTERNATIONAL GROUND_SHIPMENT_ID GROUP_MPS INVOICE JOB_GLOBAL_TRACKING_NUMBER ORDER_GLOBAL_TRACKING_NUMBER ORDER_TO_PAY_NUMBER PARTNER_CARRIER_NUMBER PART_NUMBER PURCHASE_ORDER RETURN_MATERIALS_AUTHORIZATION RETURNED_TO_SHIPPER_TRACKING_NUMBER TRACKING_CONTROL_NUMBER TRACKING_NUMBER_OR_DOORTAG TRANSPORTATION_CONTROL_NUMBER SHIPPER_REFERENCE STANDARD_MPS }
Instance Attribute Summary collapse
-
#delivery_at ⇒ Object
readonly
Returns the value of attribute delivery_at.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#other_identifiers ⇒ Object
readonly
Returns the value of attribute other_identifiers.
-
#service_type ⇒ Object
readonly
Returns the value of attribute service_type.
-
#signature_name ⇒ Object
readonly
Returns the value of attribute signature_name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#tracking_number ⇒ Object
readonly
Returns the value of attribute tracking_number.
-
#unique_tracking_number ⇒ Object
readonly
Returns the value of attribute unique_tracking_number.
Instance Method Summary collapse
-
#initialize(details = {}) ⇒ TrackingInformation
constructor
A new instance of TrackingInformation.
Constructor Details
#initialize(details = {}) ⇒ TrackingInformation
Returns a new instance of TrackingInformation.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fedex_ship/tracking_information.rb', line 33 def initialize(details = {}) @details = details @tracking_number = details[:tracking_number] @unique_tracking_number = details[:tracking_number_unique_identifier] @signature_name = details[:delivery_signature_name] @service_type = details[:service][:type] @status = details[:status_detail][:description] @status_code = details[:status_detail][:code] @other_identifiers = details[:other_identifiers] if details.has_key?(:actual_delivery_timestamp) @delivery_at = Time.parse(details[:actual_delivery_timestamp]) end @events = [details[:events]].flatten.compact.map do |event_details| Event.new(event_details) end end |
Instance Attribute Details
#delivery_at ⇒ Object (readonly)
Returns the value of attribute delivery_at.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def delivery_at @delivery_at end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def details @details end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def events @events end |
#other_identifiers ⇒ Object (readonly)
Returns the value of attribute other_identifiers.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def other_identifiers @other_identifiers end |
#service_type ⇒ Object (readonly)
Returns the value of attribute service_type.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def service_type @service_type end |
#signature_name ⇒ Object (readonly)
Returns the value of attribute signature_name.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def signature_name @signature_name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def status @status end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def status_code @status_code end |
#tracking_number ⇒ Object (readonly)
Returns the value of attribute tracking_number.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def tracking_number @tracking_number end |
#unique_tracking_number ⇒ Object (readonly)
Returns the value of attribute unique_tracking_number.
31 32 33 |
# File 'lib/fedex_ship/tracking_information.rb', line 31 def unique_tracking_number @unique_tracking_number end |