Name

TrueClass — True class

Synopsis

The only instance of TrueClass is true. TrueClass provides a few logical operations, which evaluate both operands before executing the methods, unlike && or || operators.

Instance Methods

true & other

Logical AND, without short circuit behavior

true | other

Logical OR, without short circuit behavior

true ^ other

Logical exclusive Or (XOR)

Get Ruby in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.