class Addressable::URI
def port=(new_port)
Experimental RBS support (using type sampling data from the type_fusion
project).
def port=: (nil new_port) -> nil
This signature was generated using 2 samples from 1 application.
-
new_port
(String, Integer, #to_s
) -- The new port component.
def port=(new_port) if new_port != nil && new_port.respond_to?(:to_str) new_port = Addressable::URI.unencode_component(new_port.to_str) end if new_port.respond_to?(:valid_encoding?) && !new_port.valid_encoding? raise InvalidURIError, "Invalid encoding in port" end if new_port != nil && !(new_port.to_s =~ /^\d+$/) raise InvalidURIError, "Invalid port number: #{new_port.inspect}" end @port = new_port.to_s.to_i @port = nil if @port == 0 # Reset dependent values @authority = nil @normalized_port = NONE remove_composite_values # Ensure we haven't created an invalid URI validate() end