in_addr(addr) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/ipaddr.rb, line 505
  def in_addr(addr)
    case addr
    when Array
      octets = addr
    else
      m = RE_IPV4ADDRLIKE.match(addr) or return nil
      octets = m.captures
    end
    octets.inject(0) { |i, s|
      (n = s.to_i) < 256 or raise ArgumentError, "invalid address"
      s.match(/\A0./) and raise ArgumentError, "zero-filled number is ambiguous"
      i << 8 | n
    }
  end
Register or log in to add new notes.