class AfterShip::Checkpoint
Wrapper object for AfterShip
tracking checkpoint: www.aftership.com/docs/api/4/trackings/get-trackings-slug-tracking_number
Attributes
Date and time of the checkpoint, provided by courier.
Empty String, YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS, or YYYY-MM-DDTHH:MM:SS+TIMEZONE.
Should always be available.
@return [DateTime]
Location info (if any).
May be empty.
@return [String]
Country ISO Alpha-3 (three letters) of the checkpoint.
May be empty.
@return [String]
Country name of the checkpoint, may also contain other location info. Seems to be Alpha-2 code, e.g. IN
, DE
.
May be empty.
@return [String]
Date and time of the tracking created.
Should always be available.
@return [DateTime]
The unique code of courier for this checkpoint message.
Should always be available.
@return [String]
Location info (if any).
May be empty.
@return [String]
Same as tag, except human-friendly:
-
Pending
=>Pending
-
InfoReceived
=> +Info Received+ -
InTransit
=> +In Transit+ -
OutForDelivery
=> +Out For Delivery+ -
AttemptFail
=> +Attempt Failed+ -
Delivered
=>Delivered
-
Exception
=>Exception
-
Expired
=>Expired
@return [String]
Status of the checkpoint.
Should always be available.
@return [String]
Location info (if any).
May be empty.
@return [String]
Public Class Methods
Better interface for a checkpoint.
@param data [Hash] checkpoint hash
# File lib/after_ship/checkpoint.rb, line 107 def initialize(data) load_attributes(data) end
Public Instance Methods
Date and time of the checkpoint, provided by courier.
@return [DateTime]
# File lib/after_ship/checkpoint.rb, line 143 def checkpoint_time=(value) @checkpoint_time = DateUtils.parse(value) end
Date and time of the tracking created.
@return [DateTime]
# File lib/after_ship/checkpoint.rb, line 125 def created_at=(value) @created_at = DateUtils.parse(value) end
The unique code of courier for this checkpoint message.
Should always be available.
@return [String]
# File lib/after_ship/checkpoint.rb, line 116 def slug=(value) @slug = value self.courier = value.upcase @slug end
Status of the checkpoint.
Should always be available.
@return [String]
# File lib/after_ship/checkpoint.rb, line 134 def tag=(value) @tag = value self.status = TAG_STATUS.fetch(value) @tag end