Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: URI.decode_www_formのサンプルコードでrassocがエラーを出していたので修正 #2884

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions refm/api/src/uri/URI
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ enc で指定したエンコーディングの文字列が URL エンコード

require 'uri'
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"}
p ary #=> [['a', '1'], ['a', '2'], ['b', '3']]
p ary.assoc('a').last #=> '1'
p ary.assoc('b').last #=> '3'
p ary.rassoc('2').first #=> 'a'
p Hash[ary] # => {"a"=>"2", "b"=>"3"}

@param str デコード対象の文字列
@param enc エンコーディング
Expand Down