class Trackerific::Builders::UPS

Protected Instance Methods

build() click to toggle source

Builds the UPS track request XML @api private

# File lib/trackerific/builders/ups.rb, line 10
def build
  add_access_request
  add_track_request
end

Private Instance Methods

add_access_request() click to toggle source

Adds the user credentials to the XML @api private

# File lib/trackerific/builders/ups.rb, line 19
def add_access_request
  builder.AccessRequest do |ar|
    ar.AccessLicenseNumber key
    ar.UserId user_id
    ar.Password password
  end
end
add_track_request() click to toggle source

Adds the track request and package id to the XML @api private

# File lib/trackerific/builders/ups.rb, line 29
def add_track_request
  builder.TrackRequest do |tr|
    tr.Request do |r|
      r.RequestAction 'Track'
      r.RequestOption 'activity'
    end
    tr.TrackingNumber package_id
  end
end