Class: USPS::Response::TrackingFieldLookup

Inherits:
Base
  • Object
show all
Defined in:
lib/usps/response/tracking_field_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) ⇒ TrackingFieldLookup

Returns a new instance of TrackingFieldLookup.



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

def initialize(xml)
  @summary = parse(xml.search("TrackSummary"))
  @details = []
  xml.search("TrackDetail").each do |detail|
    @details << parse(detail)
  end
end

Instance Attribute Details

#detailsObject

Returns the value of attribute details.



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

def details
  @details
end

#summaryObject

Returns the value of attribute summary.



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

def summary
  @summary
end