class SyntaxTree::IVar
IVar
represents an instance variable literal.
@variable
Attributes
- String
-
the name of the instance variable
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 6900 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 6935 def ===(other) other.is_a?(IVar) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 6906 def accept(visitor) visitor.visit_ivar(self) end
Source
# File lib/syntax_tree/node.rb, line 6910 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 6914 def copy(value: nil, location: nil) node = IVar.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 6927 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end