Skip to content
On this page
class · Ruby 4.0

Prism::MultiWriteNode

< Prism::Node 19 instance methods 2 class methods

Represents a write to a multi-target expression.

a, b, c = 1, 2, 3
^^^^^^^^^^^^^^^^^

Class methods 2

Instance methods 19

Attributes
Read

Represents the targets expressions before a splat node.

a, b, * = 1, 2, 3, 4, 5
^^^^

The splat node can be absent, in that case all target expressions are in the left field.

a, b, c = 1, 2, 3, 4, 5
^^^^^^^
Read

Represents a splat node in the target expression.

a, b, *c = 1, 2, 3, 4
      ^^

The variable can be empty, this results in a SplatNode with a nil expression field.

a, b, * = 1, 2, 3, 4
      ^

If the * is omitted, this field will contain an ImplicitRestNode

a, b, = 1, 2, 3, 4
    ^
Read

Represents the targets expressions after a splat node.

a, *, b, c = 1, 2, 3, 4, 5
      ^^^^
Read

The value to write to the targets. It can be any non-void expression.

a, b, c = 1, 2, 3
          ^^^^^^^