mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add document about URI.join. [ruby-core:32462]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
060f18c0d9
commit
d339fed3ad
1 changed files with 14 additions and 1 deletions
|
@ -643,9 +643,22 @@ module URI
|
|||
#
|
||||
# require 'uri'
|
||||
#
|
||||
# p URI.join("http://localhost/","main.rbx")
|
||||
# p URI.join("http://example.com/","main.rbx")
|
||||
# # => #<URI::HTTP:0x2022ac02 URL:http://localhost/main.rbx>
|
||||
#
|
||||
# p URI.join('http://example.com', 'foo')
|
||||
# # => #<URI::HTTP:0x01ab80a0 URL:http://example.com/foo>
|
||||
#
|
||||
# p URI.join('http://example.com', '/foo', '/bar')
|
||||
# # => #<URI::HTTP:0x01aaf0b0 URL:http://example.com/bar>
|
||||
#
|
||||
# p URI.join('http://example.com', '/foo', 'bar')
|
||||
# # => #<URI::HTTP:0x801a92af0 URL:http://example.com/bar>
|
||||
#
|
||||
# p URI.join('http://example.com', '/foo/', 'bar')
|
||||
# # => #<URI::HTTP:0x80135a3a0 URL:http://example.com/foo/bar>
|
||||
#
|
||||
#
|
||||
def self.join(*str)
|
||||
DEFAULT_PARSER.join(*str)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue