Sha256: 3e55a47ee1c53496f9077ff7043281f1395eb7d6f0995f73c8adf1194391b157

Contents?: true

Size: 482 Bytes

Versions: 16

Compression:

Stored size: 482 Bytes

Contents

require 'glimmer/xml/node'

module Glimmer
  module XML
    class DepthFirstSearchIterator
      def initialize(node, node_visitor)
        @node = node
        @node_visitor = node_visitor
      end

      def iterate
        process(@node)
      end

      def process(node)
        @node_visitor.process_before_children(node)
        node.children.each { |child| process(child) } if node.is_a?(Node)
        @node_visitor.process_after_children(node)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
glimmer-dsl-xml-0.2.0 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-dsl-xml-0.1.0 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-dsl-css-0.1.0 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.8.2 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.8.1 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.8.0 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.8 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.7 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.6 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.5 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.4 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.3 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.2 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.1 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.7.0 lib/glimmer/xml/depth_first_search_iterator.rb
glimmer-0.6.0 lib/glimmer/xml/depth_first_search_iterator.rb