# File lib/Dnsruby/ipv4.rb, line 21 21: def self.create(arg) 22: case arg 23: when IPv4 24: return arg 25: when Regex 26: if (0..255) === (a = $1.to_i) && 27: (0..255) === (b = $2.to_i) && 28: (0..255) === (c = $3.to_i) && 29: (0..255) === (d = $4.to_i) 30: return self.new([a, b, c, d].pack("CCCC")) 31: else 32: raise ArgumentError.new("IPv4 address with invalid value: " + arg) 33: end 34: else 35: raise ArgumentError.new("cannot interpret as IPv4 address: #{arg.inspect}") 36: end 37: end
# File lib/Dnsruby/ipv4.rb, line 62 62: def ==(other) 63: return @address == other.address 64: end
# File lib/Dnsruby/ipv4.rb, line 66 66: def eql?(other) 67: return self == other 68: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.