Module: Trackerific
- Defined in:
- lib/trackerific.rb,
lib/ups.rb,
lib/usps.rb,
lib/fedex.rb,
lib/trackerific_event.rb,
lib/trackerific_details.rb
Overview
Trackerific is a UPS, FedEx and USPS tracking provider.
Defined Under Namespace
Classes: Base, Details, Error, Event, FedEx, UPS, USPS
Instance Method Summary (collapse)
-
- (Trackerific::Base) tracking_service(package_id)
Checks a string for a valid package identifier, and returns a Trackerific class that should be able to track the package.
Instance Method Details
- (Trackerific::Base) tracking_service(package_id)
Checks a string for a valid package identifier, and returns a Trackerific class that should be able to track the package.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/trackerific.rb', line 46 def tracking_service(package_id) case package_id when /^.Z/, /^[HK].{10}$/ then Trackerific::UPS when /^96.{20}$/ then Trackerific::FedEx else case package_id.length when 13, 20, 22, 30 then Trackerific::USPS when 12, 15, 19 then Trackerific::FedEx else nil end end end |