Class: Shippinglogic::UPS::Track

Inherits:
Service show all
Defined in:
lib/shippinglogic/ups/track.rb

Overview

An interface to the track services provided by UPS. Allows you to get an array of events for a specific tracking number.

Accessor methods / options

  • tracking_number - the tracking number

Simple Example

Here is a very simple example:

ups = Shippinglogic::UPS.new(key, password, )
tracking_details = ups.track(:tracking_number => "my number")

tracking_details.status
# => "Delivered"

tracking_details.signature_name
# => "KKING"

tracking_details.events.first
# => #<Shippinglogic::UPS::Track::Event @postal_code="95817", @name="Delivered", @state="CA",
#     @city="Sacramento", @type="Delivered", @country="US", @occured_at=Mon Dec 08 10:43:37 -0500 2008>

tracking_details.events.first.name
# => "Delivered"

Note

UPS does support locating packages through means other than a tracking number. These are not supported and probably won’t be until someone needs them. It should be fairly simple to add, but I could not think of a reason why anyone would want to track a package with anything other than a tracking number.

Defined Under Namespace

Classes: Details

Instance Attribute Summary

Attributes inherited from Service

#base

Class Method Summary collapse

Methods inherited from Service

#initialize

Methods included from Validation

#errors, #valid?

Methods included from Attributes

included

Methods inherited from Proxy

#initialize

Constructor Details

This class inherits a constructor from Shippinglogic::Service

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Shippinglogic::Proxy

Class Method Details

.pathObject



37
38
39
# File 'lib/shippinglogic/ups/track.rb', line 37

def self.path
  "/Track"
end