Nil is the class of nil.

Methods

clone()

Get a copy of nil.

IO.println(nil.clone()) #> nil

hash

Return a hash for nil: 0.

IO.println(nil.hash) #> 0

to_s

Transform nil into a String: "nil"

IO.println(nil.to_s) #> nil

Operators

! operator

Return the negation of nil: true. nil is one of the two values (with false) that evaluates to false.

IO.println(!nil) #> true