Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/ipaddr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ class InvalidPrefixError < InvalidAddressError; end

# Creates a new ipaddr containing the given network byte ordered
# string form of an IP address.
def IPAddr::new_ntoh(addr)
return IPAddr.new(IPAddr::ntop(addr))
def self.new_ntoh(addr)
return new(ntop(addr))
end

# Convert a network byte ordered string form of an IP address into
# human readable form.
def IPAddr::ntop(addr)
def self.ntop(addr)
case addr.size
when 4
s = addr.unpack('C4').join('.')
Expand Down