Class: Hash

Inherits:
Object show all
Defined in:
lib/typus/hash.rb

Instance Method Summary collapse

Instance Method Details

#compactObject

Remove nil and empty keys.



4
5
6
# File 'lib/typus/hash.rb', line 4

def compact
  delete_if { |key, value| value.nil? || value.empty? }
end