Skip to content

Commit 30212d3

Browse files
committedJun 26, 2025··
[DOC] State that uri library is needed to call Kernel#URI
So that the example works as-is.
1 parent 0a491f9 commit 30212d3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎lib/uri/common.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,13 +889,16 @@ module Kernel
889889
# Returns a \URI object derived from the given +uri+,
890890
# which may be a \URI string or an existing \URI object:
891891
#
892+
# require 'uri'
892893
# # Returns a new URI.
893894
# uri = URI('http://github.com/ruby/ruby')
894895
# # => #<URI::HTTP http://github.com/ruby/ruby>
895896
# # Returns the given URI.
896897
# URI(uri)
897898
# # => #<URI::HTTP http://github.com/ruby/ruby>
898899
#
900+
# You must require 'uri' to use this method.
901+
#
899902
def URI(uri)
900903
if uri.is_a?(URI::Generic)
901904
uri

0 commit comments

Comments
 (0)
Please sign in to comment.