A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.ruby-lang.org/en/master/TrueClass.html below:

class TrueClass - Documentation for Ruby 3.5

class TrueClass

The class of the singleton object true.

Several of its methods act as operators:

One other method:

Public Instance Methods

Source

static VALUE
true_and(VALUE obj, VALUE obj2)
{
    return RBOOL(RTEST(obj2));
}

Returns false if object is false or nil, true otherwise:

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

Source

#define case_equal rb_equal

Returns true or false.

Like Object#==, if object is an instance of Object (and not an instance of one of its many subclasses).

This method is commonly overridden by those subclasses, to provide meaningful semantics in case statements.

Source

static VALUE
true_xor(VALUE obj, VALUE obj2)
{
    return rb_obj_not(obj2);
}

Returns true if object is false or nil, false otherwise:

true ^ Object.new 
true ^ false      
true ^ nil        

Source

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

Returns true:

true | Object.new 
true | false      
true | nil        

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

true | raise 
true || raise 

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4