Skip to content
On this page

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class · Ruby 3.4

Prism::CaseMatchNode

< Prism::Node 17 instance methods 2 class methods

Represents the use of a case statement for pattern matching.

case true
in false
end
^^^^^^^^^

Class methods 2

Instance methods 17

Attributes
Read

Represents the conditions of the case match.

case true; in false; end
           ^^^^^^^^

Represents the else clause of the case match.

case true; in false; else; end
                     ^^^^
Read

Represents the predicate of the case match. This can be either nil or any [non-void expressions](github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).

case true; in false; end
^^^^