Class: USPS::Request::TrackingFieldLookup

Inherits:
Base
  • Object
show all
Defined in:
lib/usps/request/tracking_field_lookup.rb

Overview

Given a valid USPS tracking number, use this class to request tracking information from USPS’s systems.

Returns a USPS::Response::TrackingFieldLookup object with the pertinent information

Instance Method Summary collapse

Methods inherited from Base

#api, config, #response_for, #secure?, #send!

Constructor Details

#initialize(track_id) ⇒ TrackingFieldLookup

Build a new TrackingLookup request. Takes the USPS tracking number to request information for



17
18
19
# File 'lib/usps/request/tracking_field_lookup.rb', line 17

def initialize(track_id)
  @track_id = track_id
end

Instance Method Details

#buildObject



21
22
23
24
25
# File 'lib/usps/request/tracking_field_lookup.rb', line 21

def build
  super do |builder|
    builder.tag!('TrackID', :ID => @track_id)
  end
end