Class: Socket
- Inherits:
-
Object
- Object
- Socket
- Defined in:
- lib/liquid/ext/socket.rb
Class Method Summary collapse
Class Method Details
.fqdn ⇒ Object
7 8 9 |
# File 'lib/liquid/ext/socket.rb', line 7 def self.fqdn Socket.gethostbyaddr(IPAddr.new(ipaddress).hton)[0] end |
.ipaddress ⇒ Object
2 3 4 5 |
# File 'lib/liquid/ext/socket.rb', line 2 def self.ipaddress hostname = %x(hostname).chomp getaddrinfo(hostname, nil).first[3] end |