Class: YARP::ForwardingArgumentsNode

Inherits:
YARPNode
  • Object
show all
Defined in:
lib/yarp/node.rb,
ext/yarp/api_node.c

Overview

Represents forwarding all arguments to this method to another method.

def foo(...)
  bar(...)
  ^^^^^^^^
end

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ ForwardingArgumentsNode

def initialize: (location: Location) -> void



4361
4362
4363
# File 'lib/yarp/node.rb', line 4361

def initialize(location)
  @location = location
end

Instance Method Details

#accept(visitor) ⇒ Object

def accept: (visitor: Visitor) -> void



4366
4367
4368
# File 'lib/yarp/node.rb', line 4366

def accept(visitor)
  visitor.visit_forwarding_arguments_node(self)
end

#child_nodesObject Also known as: deconstruct

def child_nodes: () -> Array[nil | Node]



4371
4372
4373
# File 'lib/yarp/node.rb', line 4371

def child_nodes
  []
end

#comment_targetsObject

def comment_targets: () -> Array[Node | Location]



4376
4377
4378
# File 'lib/yarp/node.rb', line 4376

def comment_targets
  []
end

#copy(**params) ⇒ Object

def copy: (**params) -> ForwardingArgumentsNode



4381
4382
4383
4384
4385
# File 'lib/yarp/node.rb', line 4381

def copy(**params)
  ForwardingArgumentsNode.new(
    params.fetch(:location) { location },
  )
end

#deconstruct_keys(keys) ⇒ Object

def deconstruct_keys: (keys: Array) -> Hash[Symbol, nil | Node | Array | String | Token | Array | Location]



4391
4392
4393
# File 'lib/yarp/node.rb', line 4391

def deconstruct_keys(keys)
  { location: location }
end

#inspect(inspector = NodeInspector.new) ⇒ Object



4395
4396
4397
4398
# File 'lib/yarp/node.rb', line 4395

def inspect(inspector = NodeInspector.new)
  inspector << inspector.header(self)
  inspector.to_str
end