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

[DOC] Enhanced RDoc for URI #55

Merged
merged 2 commits into from
Jan 8, 2023
Merged
Changes from 1 commit
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
Next Next commit
Enhanced RDoc for URI
BurdetteLamar committed Jan 8, 2023
commit c4dedbd706361fb63b1e7ebbc8f6f09958fb2047
8 changes: 7 additions & 1 deletion lib/uri/common.rb
Original file line number Diff line number Diff line change
@@ -829,7 +829,13 @@ def self.get_encoding(label)
module Kernel

#
# Returns +uri+ converted to an URI object.
# Returns a new \URI object derived from the given +uri+,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not necessarily a new URI object. If uri is a URI object, then it returns uri itself and doesn't create a new one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

# which may be a \URI string or an existing \URI object:
#
# uri = URI('http://github.com/ruby/ruby')
# # => #<URI::HTTP http://github.com/ruby/ruby>
# URI(uri)
# # => #<URI::HTTP http://github.com/ruby/ruby>
#
def URI(uri)
if uri.is_a?(URI::Generic)