Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Object#nil?
() -> false
obj.nil? → true or false
object.c
View on GitHub ↗
VALUE
rb_false(VALUE obj)
{
return Qfalse;
}
Only the object nil responds true to nil?.
Example
Object.new.nil? #=> false nil.nil? #=> true