Object
check if ip has prefix
# File lib/validator/ip_address.rb, line 10 def has_prefix? @value =~ /\// end
IPv4 determination by . (dot)
# File lib/validator/ip_address.rb, line 27 def is_ipv4? @value =~ /\./ end
# File lib/validator/ip_address.rb, line 47 def valid? valid_ipv4? || valid_ipv6? end
# File lib/validator/ip_address.rb, line 39 def valid_ipv4? IPAddress(@value).ipv4? rescue false end
IPv4 addresses which are only 32 bits long
# File lib/validator/ip_address.rb, line 15 def valid_ipv4_prefix? prefix = get_prefix (prefix >= 1 and prefix <= 32) end
# File lib/validator/ip_address.rb, line 43 def valid_ipv6? IPAddress(@value).ipv6? rescue false end
Generated with the Darkfish Rdoc Generator 2.