Class: USPS::Request::TrackingLookup
- Defined in:
- lib/usps/request/tracking_lookup.rb
Overview
Given a valid USPS tracking number, use this class to request tracking information from USPS’s systems.
Returns a USPS::Response::TrackingLookup object with the pertinent information
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(track_id) ⇒ TrackingLookup
constructor
Build a new TrackingLookup request.
Methods inherited from Base
#api, config, #response_for, #secure?, #send!
Constructor Details
#initialize(track_id) ⇒ TrackingLookup
Build a new TrackingLookup request. Takes the USPS tracking number to request information for
17 18 19 |
# File 'lib/usps/request/tracking_lookup.rb', line 17 def initialize(track_id) @track_id = track_id end |
Instance Method Details
#build ⇒ Object
21 22 23 24 25 |
# File 'lib/usps/request/tracking_lookup.rb', line 21 def build super do |builder| builder.tag!('TrackID', :ID => @track_id) end end |