rack-remove-param 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack/remove-param.rb +3 -2
- metadata +1 -1
data/lib/rack/remove-param.rb
CHANGED
@@ -28,8 +28,9 @@ module Rack
|
|
28
28
|
@params_to_filter = params.is_a?(String) ? Array.new(1, params) : Array.new(params)
|
29
29
|
end
|
30
30
|
|
31
|
-
def delete_param(hash)
|
32
|
-
@params_to_filter
|
31
|
+
def delete_param(hash, param_to_filter = nil)
|
32
|
+
to_filter = param_to_filter ? param_to_filter : @params_to_filter
|
33
|
+
to_filter.each do |param|
|
33
34
|
hash.delete(param)
|
34
35
|
hash.each{|k, value| delete_param(value, param) if value.is_a?(Hash) }
|
35
36
|
end
|