method

compact

Importance_1
v2_5_5 - Show latest stable - 0 notes - Class: Hash

Not found

The exact documentation you were looking for could not be found. Here is the best guess.

compact() public

Returns a new hash with the nil values/key pairs removed

h = { a: 1, b: false, c: nil }
h.compact     #=> { a: 1, b: false }
h             #=> { a: 1, b: false, c: nil }
Show source
Register or log in to add new notes.