Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v1_9_3_125) is shown here.
valid_v4?(addr)
public
Returns true if addr is
a valid IPv4 address.
# File lib/ipaddr.rb, line 28
def valid_v4?(addr)
if /\A(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\Z/ =~ addr
return $~.captures.all? {|i| i.to_i < 256}
end
return false
end