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 tracking service.
Instance Method Details
- (Trackerific::Base) tracking_service(package_id)
Checks a string for a valid package tracking service
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/trackerific.rb', line 77 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 |