Class: EdifactConverter::DebugHandler

Inherits:
EmptyHandler show all
Defined in:
lib/edifact_converter/debug_handler.rb

Instance Attribute Summary

Attributes inherited from EmptyHandler

#locator, #next_handler

Instance Method Summary collapse

Methods inherited from EmptyHandler

#initialize, #method_missing

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 Method Details

#endDocumentObject



13
14
15
16
17
18
# File 'lib/edifact_converter/debug_handler.rb', line 13

def endDocument
  p @level
  #@level -= 1
  #print 'Edifact'
  super
end

#endSegment(name) ⇒ Object



38
39
40
41
# File 'lib/edifact_converter/debug_handler.rb', line 38

def endSegment(name)
  #@level -= 1
  super
end

#endSegmentGroup(name) ⇒ Object



26
27
28
29
30
# File 'lib/edifact_converter/debug_handler.rb', line 26

def endSegmentGroup(name)
  print "End Group #{name}"
  @level -= 1
  super
end


43
44
45
46
# File 'lib/edifact_converter/debug_handler.rb', line 43

def print(name)
  text = "  #{@level} - #{name}"
  puts text
end

#startDocumentObject



7
8
9
10
11
# File 'lib/edifact_converter/debug_handler.rb', line 7

def startDocument
  @level = 1
  print 'Edifact'
  super
end

#startSegment(name, position = nil) ⇒ Object



32
33
34
35
36
# File 'lib/edifact_converter/debug_handler.rb', line 32

def startSegment(name, position = nil)
  print "#{name} #{position}"
  #@level += 1
  super
end

#startSegmentGroup(name, position = nil, hidden = false) ⇒ Object



20
21
22
23
24
# File 'lib/edifact_converter/debug_handler.rb', line 20

def startSegmentGroup(name, position = nil, hidden = false)
  @level += 1
  print "Start Group #{name} #{position}"
  super
end