class Hash def needs(*keys) keys.each { |key| self[key] ||= '' } end alias :need :needs def keeps(*checks) delete_if do |key, value| checks.none? { |check| check === key } end end alias :keep :keeps alias :whitelist :keeps end