Flowdock
method

gethostname

Importance_1
Ruby latest stable (v1_9_3_392) - 0 notes - Class: Socket
gethostname() public

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 Socket.ip_address_list.

Show source
Register or log in to add new notes.