@@ -143,6 +143,7 @@ def self.cache
143143 # @return [RDF::URI] an immutable, frozen URI object
144144 def self . intern ( *args )
145145 str = args . first
146+ args << { } unless args . last . is_a? ( Hash ) # FIXME: needed until #to_hash is removed to avoid DEPRECATION warning.
146147 ( cache [ ( str = str . to_s ) . to_sym ] ||= self . new ( *args ) ) . freeze
147148 end
148149
@@ -200,10 +201,10 @@ def self.normalize_path(path)
200201 end
201202
202203 ##
203- # @overload URI(uri, options = {} )
204+ # @overload URI(uri, ** options)
204205 # @param [URI, String, #to_s] uri
205206 #
206- # @overload URI(options = {} )
207+ # @overload URI(** options)
207208 # @param [Hash{Symbol => Object}] options
208209 # @option [String, #to_s] :scheme The scheme component.
209210 # @option [String, #to_s] :user The user component.
@@ -281,7 +282,7 @@ def urn?
281282 #
282283 # @return [Boolean] `true` or `false`
283284 # @see http://en.wikipedia.org/wiki/URI_scheme
284- # @see { NON_HIER_SCHEMES}
285+ # @see NON_HIER_SCHEMES
285286 # @since 1.0.10
286287 def hier?
287288 !NON_HIER_SCHEMES . include? ( scheme )
@@ -1218,7 +1219,13 @@ def query_values=(value)
12181219 return
12191220 end
12201221
1221- value = value . to_hash if value . respond_to? ( :to_hash )
1222+ value = if value . respond_to? ( :to_h )
1223+ value . to_h
1224+ elsif value . respond_to? ( :to_hash )
1225+ value . to_hash
1226+ else
1227+ value
1228+ end
12221229 self . query = case value
12231230 when Array , Hash
12241231 value . map do |( k , v ) |
0 commit comments