Module: SyntaxTree::Reflection

Defined in:
lib/syntax_tree/reflection.rb

Overview

This module is used to provide some reflection on the various types of nodes and their attributes. As soon as it is required it collects all of its information.

Defined Under Namespace

Modules: Type Classes: Attribute, Node

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.nodesObject (readonly)

This is going to hold a hash of all of the nodes in the tree. The keys are the names of the nodes as symbols.



154
155
156
# File 'lib/syntax_tree/reflection.rb', line 154

def nodes
  @nodes
end

Class Method Details

.node(name) ⇒ Object

This expects a node name as a symbol and returns the node object for that node.



158
159
160
# File 'lib/syntax_tree/reflection.rb', line 158

def node(name)
  nodes.fetch(name)
end