Sha256: 6c9b14b098ee53fb4c19b97983513195ea76e1df49f043f47400a541b04e2417

Contents?: true

Size: 429 Bytes

Versions: 1

Compression:

Stored size: 429 Bytes

Contents

require File.dirname(__FILE__) + '/base'

module TodoNext::Tree::Visitor
  class ExampleNodesRemover < Base

    def visit(curr_node, level, parent) #nodoc#
      if curr_node.example?
        remove_from_tree(curr_node)
      elsif curr_node.has_children?
        visit_children_of(curr_node, level)
      end
    end

  private

    def remove_from_tree(curr_node)
      curr_node.remove_from_parent_children
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
todo_next-0.0.2 lib/todo_next/tree/visitor/example_remover_visitor.rb