class SyntaxTree::VCall
VCall
represent any plain named object with Ruby that could be either a local variable or a method call.
variable
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 11742 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 11777 def ===(other) other.is_a?(VCall) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 11748 def accept(visitor) visitor.visit_vcall(self) end
Source
# File lib/syntax_tree/node.rb, line 11781 def access_control? @access_control ||= %w[private protected public].include?(value.value) end
Source
# File lib/syntax_tree/node.rb, line 11752 def child_nodes [value] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 11756 def copy(value: nil, location: nil) node = VCall.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 11769 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end