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