Method: TrueClass#|

Defined in:
object.c

#|(object) ⇒ true

Returns true:

true | Object.new # => true
true | false      # => true
true | nil        # => true

Argument object is evaluated. This is different from true with the short-circuit operator, whose operand is evaluated only if necessary:

true | raise # => Raises RuntimeError.
true || raise # => true

Returns:

  • (true)


1537
1538
1539
1540
1541
# File 'object.c', line 1537

static VALUE
true_or(VALUE obj, VALUE obj2)
{
    return Qtrue;
}