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

#build_switch_path, #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.



4
5
6
# File 'lib/ups/parsers/ship_confirm_parser.rb', line 4

def identification_number
  @identification_number
end

#shipment_digestObject

Returns the value of attribute shipment_digest.



4
5
6
# File 'lib/ups/parsers/ship_confirm_parser.rb', line 4

def shipment_digest
  @shipment_digest
end

Instance Method Details

#value(value) ⇒ Object



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

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