Class: Shere::ExternalAddress
- Inherits:
-
Struct
- Object
- Struct
- Shere::ExternalAddress
- Defined in:
- lib/shere.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
Instance Method Summary collapse
-
#initialize ⇒ ExternalAddress
constructor
A new instance of ExternalAddress.
- #ip_address ⇒ Object
- #reverse_lookup_host ⇒ Object
Constructor Details
#initialize ⇒ ExternalAddress
Returns a new instance of ExternalAddress.
6 7 8 |
# File 'lib/shere.rb', line 6 def initialize super(external_address) end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address
5 6 7 |
# File 'lib/shere.rb', line 5 def address @address end |
Instance Method Details
#ip_address ⇒ Object
10 11 12 |
# File 'lib/shere.rb', line 10 def ip_address address.ip_address end |
#reverse_lookup_host ⇒ Object
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 |