Module: PackageTracker::Carriers::UPS
- Extended by:
- PackageTracker::Carrier, UPS
- Included in:
- UPS
- Defined in:
- lib/package_tracker/carriers/ups.rb
Constant Summary collapse
- TEST_URL =
"wwwcie.ups.com"
- LIVE_URL =
"www.ups.com"
- PATH =
"/ups.app/xml/Track"
Instance Method Summary collapse
- #delivered_status ⇒ Object
- #match(tracking_number) ⇒ Object
- #track(tracking_number, options) ⇒ Object
Methods included from PackageTracker::Carrier
Instance Method Details
#delivered_status ⇒ Object
21 22 23 |
# File 'lib/package_tracker/carriers/ups.rb', line 21 def delivered_status "DELIVERED" end |
#match(tracking_number) ⇒ Object
17 18 19 |
# File 'lib/package_tracker/carriers/ups.rb', line 17 def match(tracking_number) tracking_number =~ /^1Z\d*/ end |
#track(tracking_number, options) ⇒ Object
11 12 13 14 15 |
# File 'lib/package_tracker/carriers/ups.rb', line 11 def track(tracking_number, ) validate_credentials!([:credentials]) repsonse = Request.post(request_url([:testing]), PATH, request_data(tracking_number, [:credentials])) parse_response(tracking_number, repsonse) end |