class SyntaxTree::ArgsForward
ArgsForward
represents forwarding all kinds of arguments onto another method call.
def request(method, path, **headers, &block); end def get(...) request(:GET, ...) end def post(...) request(:POST, ...) end
In
the example above, both the get and post methods are forwarding all of their arguments (positional, keyword, and block) on to the request method. The ArgsForward
node appears in both the caller (the request method calls) and the callee (the get and post definitions).
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 1008 def initialize(location:) @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 1038 def ===(other) other.is_a?(ArgsForward) end
Source
# File lib/syntax_tree/node.rb, line 1013 def accept(visitor) visitor.visit_args_forward(self) end
Source
# File lib/syntax_tree/node.rb, line 1017 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 1021 def copy(location: nil) node = ArgsForward.new(location: location || self.location) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 1030 def deconstruct_keys(_keys) { location: location, comments: comments } end