method
valid_v4?
v1_9_2_180 -
Show latest stable
- Class:
IPSocket
valid_v4?(addr)public
No documentation available.
# File lib/ipaddr.rb, line 26
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