Class: SyntaxTree::Reflection::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/reflection.rb

Overview

This class represents one of our nodes in the tree. We’re going to use it as a placeholder for collecting all of the various places that nodes are used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, comment, attributes, visitor_method) ⇒ Node

Returns a new instance of Node.



143
144
145
146
147
148
# File 'lib/syntax_tree/reflection.rb', line 143

def initialize(name, comment, attributes, visitor_method)
  @name = name
  @comment = comment
  @attributes = attributes
  @visitor_method = visitor_method
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



141
142
143
# File 'lib/syntax_tree/reflection.rb', line 141

def attributes
  @attributes
end

#commentObject (readonly)

Returns the value of attribute comment.



141
142
143
# File 'lib/syntax_tree/reflection.rb', line 141

def comment
  @comment
end

#nameObject (readonly)

Returns the value of attribute name.



141
142
143
# File 'lib/syntax_tree/reflection.rb', line 141

def name
  @name
end

#visitor_methodObject (readonly)

Returns the value of attribute visitor_method.



141
142
143
# File 'lib/syntax_tree/reflection.rb', line 141

def visitor_method
  @visitor_method
end