method

ip_port

v2_1_10 - Show latest stable - Class: Addrinfo
ip_port()
public

Returns the port number as an integer.

Addrinfo.tcp("127.0.0.1", 80).ip_port    #=> 80
Addrinfo.tcp("::1", 80).ip_port          #=> 80