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.



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

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.



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

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