lib/better_ipaddr/classes.rb in better_ipaddr-0.1.6 vs lib/better_ipaddr/classes.rb in better_ipaddr-0.2.0

- old
+ new

@@ -24,9 +24,17 @@ else new(address, family) end end + # Convert the given string to an IPAddr subclass. + # + # @param address [String] the string to convert + # @return [IPAddr::V4, IPAddr::V6, IPAddr::EUI48] + def self.parse(address) + specialize IPAddr.new(address) + end + # Return the given address as an instance of a class specific to # its address family. # # @param address [IPAddr] the address to convert # @return [IPAddr::V4, IPAddr::V6, IPAddr::EUI48]