End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Object#nil?
obj.nil? → true or false
object.c
View on GitHub ↗
MJIT_FUNC_EXPORTED VALUE
rb_false(VALUE obj)
{
return Qfalse;
}
Only the object nil responds true to nil?.
Example
Object.new.nil? #=> false nil.nil? #=> true