Represents a find pattern in pattern matching.

foo in *bar, baz, *qux
       ^^^^^^^^^^^^^^^

foo in [*bar, baz, *qux]
       ^^^^^^^^^^^^^^^^^

foo in Foo(*bar, baz, *qux)
       ^^^^^^^^^^^^^^^^^^^^

foo => *bar, baz, *qux
       ^^^^^^^^^^^^^^^
Attributes
Read

Represents the optional constant preceding the pattern

foo in Foo(*bar, baz, *qux)
       ^^^
Read

Represents the first wildcard node in the pattern.

foo in *bar, baz, *qux
       ^^^^

foo in Foo(*bar, baz, *qux)
           ^^^^
Read

Represents the nodes in between the wildcards.

foo in *bar, baz, *qux
             ^^^

foo in Foo(*bar, baz, 1, *qux)
                 ^^^^^^
Read

Represents the second wildcard node in the pattern.

foo in *bar, baz, *qux
                  ^^^^

foo in Foo(*bar, baz, *qux)
                      ^^^^
Class Methods

Initialize a new FindPatternNode node.

Return a symbol representation of this node type. See Node::type.

Instance Methods

Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.

def accept: (Visitor visitor) -> void

def child_nodes: () -> Array

def closing: () -> String?

The location of the closing brace.

foo in [*bar, baz, *qux]
                       ^

foo in Foo(*bar, baz, *qux)
                          ^

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

def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?constant: ConstantPathNode | ConstantReadNode | nil, ?left: SplatNode, ?requireds: Array, ?right: SplatNode | MissingNode, ?opening_loc: Location?, ?closing_loc: Location?) -> FindPatternNode

def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, constant: ConstantPathNode | ConstantReadNode | nil, left: SplatNode, requireds: Array, right: SplatNode | MissingNode, opening_loc: Location?, closing_loc: Location? }

def inspect -> String

def opening: () -> String?

The location of the opening brace.

foo in [*bar, baz, *qux]
       ^

foo in Foo(*bar, baz, *qux)
          ^

Save the closing_loc location using the given saved source so that it can be retrieved later.

Save the opening_loc location using the given saved source so that it can be retrieved later.

Return a symbol representation of this node type. See Node#type.