class Prism::ArgumentsNode - Documentation for Ruby 4.1
Description: class Prism::ArgumentsNode: Represents a set of arguments to a method or a keyword.
Keywords: ruby,class,Prism::ArgumentsNode

🔍

No recent searches

# class Prism::ArgumentsNode

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

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

### Public Class Methods

new (source, node_id, location, flags, arguments)
Source

    # File lib/prism/node.rb, line 1202
    def initialize(source, node_id, location, flags, arguments)
      @source = source
      @node_id = node_id
      @location = location
      @flags = flags
      @arguments = arguments
    end

Initialize a new `ArgumentsNode` node.

### Public Instance Methods

arguments → Array[Node]
Source

    # File lib/prism/node.rb, line 1346
    def arguments
      @arguments
    end

The list of arguments, if present. These can be any non-void expressions.

    foo(bar, baz)
        ^^^^^^^^

## Flags

### Public Instance Methods

contains_forwarding? ()
Source

    # File lib/prism/node.rb, line 1301
    def contains_forwarding?
      flags.anybits?(ArgumentsNodeFlags::CONTAINS_FORWARDING)
    end

if the arguments contain forwarding

contains_keyword_splat? ()
Source

    # File lib/prism/node.rb, line 1317
    def contains_keyword_splat?
      flags.anybits?(ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT)
    end

if the arguments contain a keyword splat

contains_keywords? ()
Source

    # File lib/prism/node.rb, line 1309
    def contains_keywords?
      flags.anybits?(ArgumentsNodeFlags::CONTAINS_KEYWORDS)
    end

if the arguments contain keywords

contains_multiple_splats? ()
Source

    # File lib/prism/node.rb, line 1333
    def contains_multiple_splats?
      flags.anybits?(ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS)
    end

if the arguments contain multiple splats

contains_splat? ()
Source

    # File lib/prism/node.rb, line 1325
    def contains_splat?
      flags.anybits?(ArgumentsNodeFlags::CONTAINS_SPLAT)
    end

if the arguments contain a splat

## Node Interface

These methods are present on all subclasses of `Node`. Read the node interface docs for more information.

### Public Class Methods

type ()
Source

    # File lib/prism/node.rb, line 1286
    def self.type
      :arguments_node
    end

See `Node.type`.

### Public Instance Methods

accept (visitor)
Source

    # File lib/prism/node.rb, line 1224
    def accept(visitor)
      visitor.visit_arguments_node(self)
    end

See `Node.accept`.

child_nodes ()
Source

    # File lib/prism/node.rb, line 1231
    def child_nodes
      [*arguments]
    end

See `Node.child_nodes`.

Also aliased as: deconstruct
comment_targets ()
Source

    # File lib/prism/node.rb, line 1255
    def comment_targets
      [*arguments] #: Array[Prism::node | Location]
    end

See `Node.comment_targets`.

compact_child_nodes ()
Source

    # File lib/prism/node.rb, line 1248
    def compact_child_nodes
      [*arguments]
    end

See `Node.compact_child_nodes`.

copy(**fields) → ArgumentsNode
Source

    # File lib/prism/node.rb, line 1265
    def copy(node_id: self.node_id, location: self.location, flags: self.flags, arguments: self.arguments)
      ArgumentsNode.new(source, node_id, location, flags, arguments)
    end

Creates a copy of self with the given fields, using self as the template.

deconstruct ()
Alias for: child_nodes
each_child_node () { |node| ... }
Source

    # File lib/prism/node.rb, line 1239
    def each_child_node(&blk)
      return to_enum(:each_child_node) unless block_given?

      arguments.each { |node| yield node }
    end

See `Node.each_child_node`.

type ()
Source

    # File lib/prism/node.rb, line 1279
    def type
      :arguments_node
    end

See `Node#type`.

## Repository

Methods related to `Relocation`.

## Slicing