Class: Hash
Instance Method Summary collapse
Instance Method Details
#cleanup ⇒ Object
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 |
#compact ⇒ Object
3 4 5 |
# File 'lib/support/hash.rb', line 3 def compact delete_if { |k, v| v.blank? } end |