Class: Fedex::TrackingInformation
- Inherits:
-
Object
- Object
- Fedex::TrackingInformation
- Defined in:
- lib/fedex/tracking_information.rb,
lib/fedex/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.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#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.
-
#tracking_number ⇒ Object
readonly
Returns the value of attribute 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.
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fedex/tracking_information.rb', line 34 def initialize(details = {}) @details = details @tracking_number = details[:tracking_number] @signature_name = details[:delivery_signature_name] @service_type = details[:service_type] @status = details[:status_description] @delivery_at = Time.parse(details[:actual_delivery_timestamp]) @events = details[:events].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/tracking_information.rb', line 31 def delivery_at @delivery_at end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
31 32 33 |
# File 'lib/fedex/tracking_information.rb', line 31 def events @events end |
#service_type ⇒ Object (readonly)
Returns the value of attribute service_type.
31 32 33 |
# File 'lib/fedex/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/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/tracking_information.rb', line 31 def status @status end |
#tracking_number ⇒ Object (readonly)
Returns the value of attribute tracking_number.
31 32 33 |
# File 'lib/fedex/tracking_information.rb', line 31 def tracking_number @tracking_number end |