Class: USPS::Response::TrackingLookup

Inherits:
Base
  • Object
show all
Defined in:
lib/usps/response/tracking_lookup.rb

Overview

Response object from a USPS::Request::TrackingLookup request. Includes a summary of the current status of the shipment, along with an array of details of the shipment’s progress

Instance Attribute Summary collapse

Attributes inherited from Base

#raw

Instance Method Summary collapse

Methods inherited from Base

parse

Constructor Details

#initialize(xml) ⇒ TrackingLookup

Returns a new instance of TrackingLookup.



9
10
11
12
13
14
15
16
# File 'lib/usps/response/tracking_lookup.rb', line 9

def initialize(xml)
  @summary = xml.search("TrackSummary").text

  @details = []
  xml.search("TrackDetail").each do |detail|
    @details << detail.text
  end
end

Instance Attribute Details

#detailsObject

Returns the value of attribute details.



7
8
9
# File 'lib/usps/response/tracking_lookup.rb', line 7

def details
  @details
end

#summaryObject

Returns the value of attribute summary.



7
8
9
# File 'lib/usps/response/tracking_lookup.rb', line 7

def summary
  @summary
end