From 30212d311ec9ebbc7191e38b1d508ea5684d6c39 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 25 Jan 2025 20:45:58 +0900 Subject: [PATCH] [DOC] State that uri library is needed to call Kernel#URI So that the example works as-is. --- lib/uri/common.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/uri/common.rb b/lib/uri/common.rb index b1a47cf..411a7e3 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -889,6 +889,7 @@ module Kernel # Returns a \URI object derived from the given +uri+, # which may be a \URI string or an existing \URI object: # + # require 'uri' # # Returns a new URI. # uri = URI('http://github.com/ruby/ruby') # # => # @@ -896,6 +897,8 @@ module Kernel # URI(uri) # # => # # + # You must require 'uri' to use this method. + # def URI(uri) if uri.is_a?(URI::Generic) uri