Skip to content
instance method

URI::Generic#coerce

(::URI::Generic | ::String oth) -> ::Array[::URI::Generic]
coerce(oth)

Args

v

URI or String

Description

Attempts to parse other URI oth, returns [parsed_oth, self].

Usage

Example
require 'uri'

uri = URI.parse("http://my.example.com")
uri.coerce("http://foo.com")
#=> [#<URI::HTTP http://foo.com>, #<URI::HTTP http://my.example.com>]