# File resolv.rb, line 1763
def self.create(arg)
case arg
when IPv4
return arg
when Regex
if (0..255) === (a = $1.to_i) &&
(0..255) === (b = $2.to_i) &&
(0..255) === (c = $3.to_i) &&
(0..255) === (d = $4.to_i)
return self.new([a, b, c, d].pack("CCCC"))
else
raise ArgumentError.new("IPv4 address with invalid value: " + arg)
end
else
raise ArgumentError.new("cannot interpret as IPv4 address: #{arg.inspect}")
end
end
# File resolv.rb, line 1802
def ==(other)
return @address == other.address
end
# File resolv.rb, line 1806
def eql?(other)
return self == other
end
# File resolv.rb, line 1793
def inspect
return "#<#{self.class} #{self.to_s}>"
end