class Addressable::URI

def scheme=(new_scheme)

Experimental RBS support (using type sampling data from the type_fusion project).

def scheme=: (String new_scheme) -> nil

This signature was generated using 5 samples from 2 applications.

Parameters:
  • new_scheme (String, #to_str) -- The new scheme component.
def scheme=(new_scheme)
  if new_scheme && !new_scheme.respond_to?(:to_str)
    raise TypeError, "Can't convert #{new_scheme.class} into String."
  elsif new_scheme
    new_scheme = new_scheme.to_str
  end
  if new_scheme && new_scheme !~ /\A[a-z][a-z0-9\.\+\-]*\z/i
    raise InvalidURIError, "Invalid scheme format: '#{new_scheme}'"
  end
  @scheme = new_scheme
  @scheme = nil if @scheme.to_s.strip.empty?
  # Reset dependent values
  @normalized_scheme = NONE
  remove_composite_values
  # Ensure we haven't created an invalid URI
  validate()
end