Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#cleanupObject



7
8
9
10
# File 'lib/support/hash.rb', line 7

def cleanup
  whitelist = %w(controller action id _input _popup resource attribute)
  delete_if { |k, v| !whitelist.include?(k) }
end

#compactObject



3
4
5
# File 'lib/support/hash.rb', line 3

def compact
  delete_if { |k, v| v.blank? }
end