Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

URI::Generic.build2

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.4 · 3.3 · 3.2 · 3.0