Class: EdifactConverter::XML112EDI::ChecksumHandler
- Inherits:
-
EmptyHandler
- Object
- EmptyHandler
- EdifactConverter::XML112EDI::ChecksumHandler
- Defined in:
- lib/edifact_converter/xml112edi/checksum_handler.rb
Instance Attribute Summary collapse
-
#inside_UNT ⇒ Object
Returns the value of attribute inside_UNT.
-
#inside_UNZ ⇒ Object
Returns the value of attribute inside_UNZ.
-
#letters ⇒ Object
Returns the value of attribute letters.
-
#segments ⇒ Object
Returns the value of attribute segments.
Attributes inherited from EmptyHandler
Instance Method Summary collapse
Methods inherited from EmptyHandler
Constructor Details
This class inherits a constructor from EdifactConverter::EmptyHandler
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class EdifactConverter::EmptyHandler
Instance Attribute Details
#inside_UNT ⇒ Object
Returns the value of attribute inside_UNT.
7 8 9 |
# File 'lib/edifact_converter/xml112edi/checksum_handler.rb', line 7 def inside_UNT @inside_UNT end |
#inside_UNZ ⇒ Object
Returns the value of attribute inside_UNZ.
7 8 9 |
# File 'lib/edifact_converter/xml112edi/checksum_handler.rb', line 7 def inside_UNZ @inside_UNZ end |
#letters ⇒ Object
Returns the value of attribute letters.
7 8 9 |
# File 'lib/edifact_converter/xml112edi/checksum_handler.rb', line 7 def letters @letters end |
#segments ⇒ Object
Returns the value of attribute segments.
7 8 9 |
# File 'lib/edifact_converter/xml112edi/checksum_handler.rb', line 7 def segments @segments end |
Instance Method Details
#startDocument ⇒ Object
9 10 11 12 |
# File 'lib/edifact_converter/xml112edi/checksum_handler.rb', line 9 def startDocument self.segments = self.letters = 0 super end |
#startSegment(name, position = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/edifact_converter/xml112edi/checksum_handler.rb', line 14 def startSegment(name, position = nil) case name when 'UNH' self.letters += 1 self.segments = 0 when 'UNT' self.inside_UNT = true when 'UNZ' self.inside_UNZ = true end self.segments += 1 unless name == 'OBJ' super end |
#value(text) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/edifact_converter/xml112edi/checksum_handler.rb', line 28 def value(text) if inside_UNT super(segments) elsif inside_UNZ super(letters) else super end self.inside_UNT = false self.inside_UNZ = false end |