method
compile
v4.2.7 -
Show latest stable
- Class:
ActionDispatch::Http::ParameterFilter::CompiledFilter
compile(filters)public
No documentation available.
# File actionpack/lib/action_dispatch/http/parameter_filter.rb, line 21
def self.compile(filters)
return lambda { |params| params.dup } if filters.empty?
strings, regexps, blocks = [], [], []
filters.each do |item|
case item
when Proc
blocks << item
when Regexp
regexps << item
else
strings << item.to_s
end
end
regexps << Regexp.new(strings.join('|'), true) unless strings.empty?
new regexps, blocks
end