Class: Fedex::TrackingInformation

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_atObject (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

#eventsObject (readonly)

Returns the value of attribute events.



31
32
33
# File 'lib/fedex/tracking_information.rb', line 31

def events
  @events
end

#service_typeObject (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_nameObject (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

#statusObject (readonly)

Returns the value of attribute status.



31
32
33
# File 'lib/fedex/tracking_information.rb', line 31

def status
  @status
end

#tracking_numberObject (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