class YARP::ArgumentsNode

Represents a set of arguments to a method or a keyword.

return foo, bar, baz
       ^^^^^^^^^^^^^

Attributes

arguments[R]

attr_reader arguments: Array

Public Class Methods

new(arguments, location) click to toggle source

def initialize: (arguments: Array, location: Location) -> void

# File lib/yarp/node.rb, line 322
def initialize(arguments, location)
  @arguments = arguments
  @location = location
end

Public Instance Methods

accept(visitor) click to toggle source

def accept: (visitor: Visitor) -> void

# File lib/yarp/node.rb, line 328
def accept(visitor)
  visitor.visit_arguments_node(self)
end
child_nodes() click to toggle source

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

# File lib/yarp/node.rb, line 333
def child_nodes
  [*arguments]
end
Also aliased as: deconstruct
comment_targets() click to toggle source

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

# File lib/yarp/node.rb, line 343
def comment_targets
  [*arguments]
end
compact_child_nodes() click to toggle source

def compact_child_nodes: () -> Array

# File lib/yarp/node.rb, line 338
def compact_child_nodes
  [*arguments]
end
copy(**params) click to toggle source

def copy: (**params) -> ArgumentsNode

# File lib/yarp/node.rb, line 348
def copy(**params)
  ArgumentsNode.new(
    params.fetch(:arguments) { arguments },
    params.fetch(:location) { location },
  )
end
deconstruct()

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

Alias for: child_nodes
deconstruct_keys(keys) click to toggle source

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

# File lib/yarp/node.rb, line 359
def deconstruct_keys(keys)
  { arguments: arguments, location: location }
end
inspect(inspector = NodeInspector.new) click to toggle source
# File lib/yarp/node.rb, line 363
def inspect(inspector = NodeInspector.new)
  inspector << inspector.header(self)
  inspector << "└── arguments: #{inspector.list("#{inspector.prefix}    ", arguments)}"
  inspector.to_str
end