Class: Shere::ExternalAddress

Inherits:
Struct
  • Object
show all
Defined in:
lib/shere.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExternalAddress

Returns a new instance of ExternalAddress.



6
7
8
# File 'lib/shere.rb', line 6

def initialize
  super(external_address)
end

Instance Attribute Details

#addressObject

Returns the value of attribute address

Returns:

  • (Object)

    the current value of address



5
6
7
# File 'lib/shere.rb', line 5

def address
  @address
end

Instance Method Details

#ip_addressObject



10
11
12
# File 'lib/shere.rb', line 10

def ip_address
  address.ip_address
end

#reverse_lookup_hostObject



14
15
16
17
18
# File 'lib/shere.rb', line 14

def reverse_lookup_host
  Socket.getaddrinfo(
    ip_address, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil,
    Socket::AI_CANONNAME, true).dig(0, 2)
end