Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

URI::Generic.build2

(::Array[nil | ::String | ::Integer]) -> ::URI::Generic
({ scheme: ::String?, userinfo: ::String?, host: ::String?, port: ::Integer?, registry: ::String?, path: ::String?, opaque: ::String?, query: ::String?, fragment: ::String? }) -> instance
build2(args)

Synopsis

See ::new.

Description

At first, tries to create a new URI::Generic instance using URI::Generic::build. But, if exception URI::InvalidComponentError is raised, then it does URI::Escape.escape all URI components and tries again.

See also .build .component .default_port also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0