End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
TrueClass#|
true | obj → true
object.c
View on GitHub ↗
static VALUE
true_or(VALUE obj, VALUE obj2)
{
return Qtrue;
}
Or—Returns true. As obj is an argument to a method call, it is always evaluated; there is no short-circuit evaluation in this case.
Example
true | puts("or") true || puts("logical or")
produces:
or