Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
TrueClass#^
(false | nil) -> true
(untyped obj) -> bool
true ^ object → !object
object.c
View on GitHub ↗
static VALUE
true_xor(VALUE obj, VALUE obj2)
{
return rb_obj_not(obj2);
}
Returns true if object is false or nil, false otherwise:
Example
true ^ Object.new # => false true ^ false # => true true ^ nil # => true