diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-15 02:56:38 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-15 02:56:38 +0000 |
commit | 68b69178f4b58abfb85495e93f7e05df247d7a1f (patch) | |
tree | 7218edf2cd8e3f1bf5075d212070274204248522 /lib/uri/common.rb | |
parent | 79a6daa394b64abdc61d84f7bdccef9423cb4502 (diff) |
* lib/uri/common.rb: make code block for rdoc.
[ci skip][fix GH-1152] Patch by @Tonkpils
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri/common.rb')
-rw-r--r-- | lib/uri/common.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 1444ae84b0..28b5c99789 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -438,12 +438,12 @@ module URI # This refers http://url.spec.whatwg.org/#concept-urlencoded-parser , # so this supports only &-separator, don't support ;-separator. # - # ary = URI.decode_www_form("a=1&a=2&b=3") - # p ary #=> [['a', '1'], ['a', '2'], ['b', '3']] - # p ary.assoc('a').last #=> '1' - # p ary.assoc('b').last #=> '3' - # p ary.rassoc('a').last #=> '2' - # p Hash[ary] # => {"a"=>"2", "b"=>"3"} + # ary = URI.decode_www_form("a=1&a=2&b=3") + # p ary #=> [['a', '1'], ['a', '2'], ['b', '3']] + # p ary.assoc('a').last #=> '1' + # p ary.assoc('b').last #=> '3' + # p ary.rassoc('a').last #=> '2' + # p Hash[ary] # => {"a"=>"2", "b"=>"3"} # # See URI.decode_www_form_component, URI.encode_www_form def self.decode_www_form(str, enc=Encoding::UTF_8, separator: '&', use__charset_: false, isindex: false) |