class method
URI::WS.build
(::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
build(args)
lib/uri/ws.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/uri/ws.rb, line 56
def self.build(args)
tmp = Util.make_components_hash(self, args)
super(tmp)
end
Description
Creates a new URI::WS object from components, with syntax checking.
The components accepted are userinfo, host, port, path, and query.
The components should be provided either as an Array, or as a Hash with keys formed by preceding the component names with a colon.
If an Array is used, the components must be passed in the order [userinfo, host, port, path, query].
Example:
Example
uri = URI::WS.build(host: 'www.example.com', path: '/foo/bar') uri = URI::WS.build([nil, "www.example.com", nil, "/path", "query"])
Currently, if passed userinfo components this method generates invalid WS URIs as per RFC 1738.