method
each_pair
v8.1.1 -
Show latest stable
- Class:
ActionDispatch::QueryParser
each_pair(s, separator = nil)public
No documentation available.
# File actionpack/lib/action_dispatch/http/query_parser.rb, line 29
def self.each_pair(s, separator = nil)
return enum_for(:each_pair, s, separator) unless block_given?
s ||= ""
splitter =
if separator
COMMON_SEP[separator] || /[#{separator}] */
else
DEFAULT_SEP
end
s.split(splitter).each do |part|
next if part.empty?
k, v = part.split("=", 2)
k = URI.decode_www_form_component(k)
v &&= URI.decode_www_form_component(v)
yield k, v
end
nil
end