Module: Ronin::Support::Network::IP::Mixin

Included in:
Mixin
Defined in:
lib/ronin/support/network/ip/mixin.rb

Overview

Provides helper methods for looking up the public and local IP address.

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#local_addressString

Determines the local IP address.

Returns:

See Also:

  • Network::IP.local_ip_address

Since:

  • 1.0.0



80
81
82
# File 'lib/ronin/support/network/ip/mixin.rb', line 80

def local_address
  Network::IP.local_address
end

#local_addressesArray<String>

Determines the local IP addresses.

Returns:

See Also:

Since:

  • 1.0.0



67
68
69
# File 'lib/ronin/support/network/ip/mixin.rb', line 67

def local_addresses
  Network::IP.local_addresses
end

#local_ipNetwork::IP

Determines the local IP.

Returns:

  • (Network::IP)

    The private, link-local, or loopback IP.

See Also:

Since:

  • 0.6.0



107
108
109
# File 'lib/ronin/support/network/ip/mixin.rb', line 107

def local_ip
  Network::IP.local_ip
end

#local_ipsArray<Network::IP>

Determines the local IPs.

Returns:

See Also:

Since:

  • 1.0.0



93
94
95
# File 'lib/ronin/support/network/ip/mixin.rb', line 93

def local_ips
  Network::IP.local_ips
end

#public_addressString?

Determines the current public IP address.

Returns:

See Also:

Since:

  • 1.0.0



40
41
42
# File 'lib/ronin/support/network/ip/mixin.rb', line 40

def public_address
  Network::IP.public_address
end

#public_ipString?

Determines the current public IP.

Returns:

See Also:

Since:

  • 0.6.0



54
55
56
# File 'lib/ronin/support/network/ip/mixin.rb', line 54

def public_ip
  Network::IP.public_ip
end