lib/better_ipaddr/classes.rb in better_ipaddr-0.2.1 vs lib/better_ipaddr/classes.rb in better_ipaddr-0.2.2
- old
+ new
@@ -48,9 +48,10 @@
# @param address [IPAddr]
# @param mask [Integer, String] a netmask or prefix length
# @param family [Integer, Nil]
# @return [IPAddr]
def self.from_ipaddr(address, prefix_length, family: self::FAMILY)
+ address = specialize(address)
new(address.to_i, family).mask(prefix_length || address.prefix_length)
end
# Create an IPAddr from a String.
#