class SyntaxTree::Ident
Ident
represents an identifier anywhere in code. It can represent a very large number of things, depending on where it is in the syntax tree.
value
Attributes
- String
-
the value of the identifier
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 6203 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 6238 def ===(other) other.is_a?(Ident) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 6209 def accept(visitor) visitor.visit_ident(self) end
Source
# File lib/syntax_tree/node.rb, line 6213 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 6217 def copy(value: nil, location: nil) node = Ident.new( value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 6230 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end