Class: UPS::Parsers::ShipConfirmParser

Inherits:
ParserBase
  • Object
show all
Defined in:
lib/ups/parsers/ship_confirm_parser.rb

Instance Attribute Summary collapse

Attributes inherited from ParserBase

#error_description, #status_code, #status_description, #switches

Instance Method Summary collapse

Methods inherited from ParserBase

#element_tracker_switch, #end_element, #initialize, #start_element, #success?, #switch_active?

Constructor Details

This class inherits a constructor from UPS::Parsers::ParserBase

Instance Attribute Details

#identification_numberObject

Returns the value of attribute identification_number


6
7
8
# File 'lib/ups/parsers/ship_confirm_parser.rb', line 6

def identification_number
  @identification_number
end

#shipment_digestObject

Returns the value of attribute shipment_digest


6
7
8
# File 'lib/ups/parsers/ship_confirm_parser.rb', line 6

def shipment_digest
  @shipment_digest
end

Instance Method Details

#value(value) ⇒ Object


8
9
10
11
12
13
14
15
# File 'lib/ups/parsers/ship_confirm_parser.rb', line 8

def value(value)
  if switch_active?(:ShipmentIdentificationNumber)
    self.identification_number = value.as_s
  elsif switch_active?(:ShipmentDigest)
    self.shipment_digest = value.as_s
  end
  super
end