Skip to content
instance method

URI::Generic#scheme=

(::String? v) -> ::String?
scheme=(v)

Args

v

String

Description

Public setter for the scheme component v (with validation).

See also URI::Generic.check_scheme.

Usage

Example
require 'uri'

uri = URI.parse("http://my.example.com")
uri.scheme = "https"
uri.to_s  #=> "https://my.example.com"
See also #route_to #select #route_from #set_authority also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0