# File lib/ipaddress.rb, line 44 def IPAddress::parse(str) # Check if an int was passed if str.kind_of? Integer return IPAddress::IPv4.new(ntoa(str)) end case str when /:.+\./ IPAddress::IPv6::Mapped.new(str) when /\./ IPAddress::IPv4.new(str) when /:/ IPAddress::IPv6.new(str) else raise ArgumentError, "Unknown IP Address #{str}" end end