method

compact_blank!

Importance_1
v7.0.0 - Show latest stable - 0 notes - Class: Hash
compact_blank!() public

Removes all blank values from the Hash in place and returns self. Uses Object#blank? for determining if a value is blank.

h = { a: "", b: 1, c: nil, d: [], e: false, f: true }
h.compact_blank!
# => { b: 1, f: true }
Show source
Register or log in to add new notes.