class SyntaxTree::KwRestParam
KwRestParam
represents defining a parameter in a method definition that accepts all remaining keyword parameters.
def method(**kwargs) end
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 7013 def initialize(name:, location:) @name = name @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 7049 def ===(other) other.is_a?(KwRestParam) && name === other.name end
Source
# File lib/syntax_tree/node.rb, line 7019 def accept(visitor) visitor.visit_kwrest_param(self) end
Source
# File lib/syntax_tree/node.rb, line 7023 def child_nodes [name] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 7027 def copy(name: nil, location: nil) node = KwRestParam.new( name: name || self.name, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 7040 def deconstruct_keys(_keys) { name: name, location: location, comments: comments } end
Source
# File lib/syntax_tree/node.rb, line 7044 def format(q) q.text("**") q.format(name) if name end