Sha256: 98962b2e3d91097d52881f9731cbb6cf1d8dd1baa59481ad092f3ff4ee2ffc23

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 Bytes

Contents

module XML
  module SAX

    # SAX Debug filter.
    #
    # Warn all SAX event methods before calling the next filter in the chain. Handy as it can be placed anywhere in a
    # pipeline to see what events are being passed to the next filter.
    #
    # ==== See
    # * XML::SAX::Filter
    #
    class Debug < Filter

      %w{
        cdata_block
        characters
        comment
        end_document
        end_element
        end_element_namespace
        error
        start_document
        start_element
        start_element_namespace
        warning
        xmldecl
      }.each do |method|
        define_method(method.to_sym) do |*args|
          warn "#{method}: #{args.inspect}"
          super(*args)
        end
      end

    end # Debug
  end # SAX
end # XML

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xml-sax-machines-0.4.1 lib/xml-sax-machines/debug.rb
xml-sax-machines-0.4.0 lib/xml-sax-machines/debug.rb
xml-sax-machines-0.3.0 lib/xml-sax-machines/debug.rb