Socket.gethostname => hostname
Class Public methods
Returns the hostname.
p Socket.gethostname #=> "hal"
Note that it is not guaranteed to be able to convert to IP address using gethostbyname, getaddrinfo, etc. If you need local IP address, use ::ip_address_list.
Please login to continue.