compact!()
Instance Public methods
Replaces current hash with non nil values.
hash = { a: true, b: false, c: nil}
hash.compact! # => { a: true, b: false}
hash # => { a: true, b: false}
Replaces current hash with non nil values.
hash = { a: true, b: false, c: nil}
hash.compact! # => { a: true, b: false}
hash # => { a: true, b: false}
Please login to continue.