class NilClass

Parent:
Object

The class of the singleton object nil.

Several of its methods act as operators:

Others act as converters, carrying the concept of nullity to other classes:

While nil doesn’t have an explicitly defined to_hash method, it can be used in ** unpacking, not adding any keyword arguments.

Another method provides inspection:

Finally, there is this query method:

Ruby Core © 1993–2024 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.