Module: PackageTracker::Carriers::FedEx
- Extended by:
- PackageTracker::Carrier, FedEx
- Included in:
- FedEx
- Defined in:
- lib/package_tracker/carriers/fedex.rb
Constant Summary collapse
- TEST_URL =
'gatewaybeta.fedex.com'
- LIVE_URL =
'gateway.fedex.com'
- PATH =
"/xml"
- PORT =
"443"
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
29 30 31 |
# File 'lib/package_tracker/carriers/fedex.rb', line 29 def delivered_status "Delivered" end |
#match(tracking_number) ⇒ Object
25 26 27 |
# File 'lib/package_tracker/carriers/fedex.rb', line 25 def match(tracking_number) tracking_number =~ /^\w{9}$/ || tracking_number =~ /^\d{12,15}$/ || tracking_number =~ /^96\d{20}$/ end |
#track(tracking_number, options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/package_tracker/carriers/fedex.rb', line 13 def track(tracking_number, ) validate_credentials!([:credentials]) repsonse = Request.post( request_url([:testing]), PATH, request_data(tracking_number, [:credentials]), :https => true, :port => PORT ) parse_response(tracking_number, repsonse) end |