Module: QAT::Utils::Network

Extended by:
Network
Included in:
Configuration, Network
Defined in:
lib/qat/utils/network.rb

Overview

This module gives helper methods for IP handling and/or validation

Instance Method Summary collapse

Instance Method Details

#is_ip?(ip) ⇒ Boolean

Validates if ip is a valid IP Address.

Parameters:

  • ip (String)

    wannabe IP Address

Returns:

  • (Boolean)


11
12
13
# File 'lib/qat/utils/network.rb', line 11

def is_ip?(ip)
  !!IPAddr.new(ip) rescue false
end