class SyntaxTree::MRHS
MRHS
represents the values that are being assigned on the right-hand side of a multiple assignment.
values = first, second, third
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 7891 def initialize(parts:, location:) @parts = parts @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 7926 def ===(other) other.is_a?(MRHS) && ArrayMatch.call(parts, other.parts) end
Source
# File lib/syntax_tree/node.rb, line 7897 def accept(visitor) visitor.visit_mrhs(self) end
Source
# File lib/syntax_tree/node.rb, line 7901 def child_nodes parts end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 7905 def copy(parts: nil, location: nil) node = MRHS.new( parts: parts || self.parts, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 7918 def deconstruct_keys(_keys) { parts: parts, location: location, comments: comments } end
Source
# File lib/syntax_tree/node.rb, line 7922 def format(q) q.seplist(parts) { |part| q.format(part) } end