Class: USPS::Response::DeliveryConfirmation
- Defined in:
- lib/usps/response/delivery_confirmation.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#confirmation ⇒ Object
(also: #confirmation_number)
readonly
Returns the value of attribute confirmation.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#postnet ⇒ Object
readonly
Returns the value of attribute postnet.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(xml) ⇒ DeliveryConfirmation
constructor
A new instance of DeliveryConfirmation.
Methods inherited from Base
Constructor Details
#initialize(xml) ⇒ DeliveryConfirmation
Returns a new instance of DeliveryConfirmation.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/usps/response/delivery_confirmation.rb', line 7 def initialize(xml) # Label is Base64 encoded @label = xml.search('DeliveryConfirmationLabel').text.unpack("m*")[0] @confirmation = xml.search('DeliveryConfirmationNumber').text @postnet = xml.search('Postnet').text @address = USPS::Address.new( :name => xml.search('ToName').text, :company => xml.search('ToFirm').text, :address => xml.search('ToAddress2').text, :address2 => xml.search('ToAddress1').text, :city => xml.search('ToCity').text, :state => xml.search('ToState').text, :zip5 => xml.search('ToZip5').text, :zip4 => xml.search('ToZip4').text ) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
3 4 5 |
# File 'lib/usps/response/delivery_confirmation.rb', line 3 def address @address end |
#confirmation ⇒ Object (readonly) Also known as: confirmation_number
Returns the value of attribute confirmation.
3 4 5 |
# File 'lib/usps/response/delivery_confirmation.rb', line 3 def confirmation @confirmation end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/usps/response/delivery_confirmation.rb', line 3 def label @label end |
#postnet ⇒ Object (readonly)
Returns the value of attribute postnet.
3 4 5 |
# File 'lib/usps/response/delivery_confirmation.rb', line 3 def postnet @postnet end |