Sha256: b1f1df2288c4894ea0ecd582cb8d58c5c899dc3ccd9cfc620869e3998544faaa

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

module Rubinius
  module AST
    class Node
      # Public: Works like #visit, but it doesn't visit the children just yet;
      # instead, lets the visitor decide when and how to do it.
      #
      # visitor - The visitor object. It must respond to methods named after the
      #           node names.
      #
      # Returns nothing.
      def lazy_visit(visitor, parent=nil, indent=false)
        name = node_name
        name = "#{name}_def" if %w[ class module ].include?(name)

        args = [name, self, parent]
        args << true if indent

        visitor.__send__ *args
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
to_source-0.1.3 lib/to_source/core_ext/node.rb