Class: NodeVisitor::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/node_visitor/adapter.rb

Overview

Abstract Adapter class

Instance Method Summary collapse

Instance Method Details

#get_children(node) ⇒ Array<Node>

Get the children of node

Parameters:

  • node (Node)

    ast node

Returns:

  • (Array<Node>)

    node children

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/node_visitor/adapter.rb', line 21

def get_children(node)
  raise NotImplementedError, 'get_children is not implemented'
end

#get_node_type(node) ⇒ Symbol

Get the type of node

Parameters:

  • node (Node)

    ast node

Returns:

  • (Symbol)

    node type

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/node_visitor/adapter.rb', line 14

def get_node_type(node)
  raise NotImplementedError, 'get_node_type is not implemented'
end

#is_node?(node) ⇒ Boolean

Check if it is a node

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


7
8
9
# File 'lib/node_visitor/adapter.rb', line 7

def is_node?(node)
  raise NotImplementedError, 'get_node_type is not implemented'
end