Skip to content
On this page
class · Ruby 4.0

Prism::UnlessNode

< Prism::Node 20 instance methods 2 class methods

Represents the use of the unless keyword, either in the block form or the modifier form.

bar unless foo
^^^^^^^^^^^^^^

unless foo then bar end
^^^^^^^^^^^^^^^^^^^^^^^

Class methods 2

Instance methods 20

Attributes

The else clause of the unless expression, if present.

unless cond then bar else baz end
                     ^^^^^^^^
Read

The condition to be evaluated for the unless expression. It can be any non-void expression.

unless cond then bar end
       ^^^^

bar unless cond
           ^^^^
Read

The body of statements that will executed if the unless condition is falsey. Will be nil if no body is provided.

unless cond then bar end
                 ^^^