2022-11-08 15:20:46 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class NetAddr
|
|
|
|
attr_accessor :ip, :port
|
|
|
|
|
|
|
|
def initialize(ip, port)
|
|
|
|
@ip = ip
|
|
|
|
@port = port
|
|
|
|
end
|
2022-11-09 07:40:17 +00:00
|
|
|
|
|
|
|
def to_s
|
|
|
|
"#{@ip}:#{@port}"
|
|
|
|
end
|
2022-11-11 09:21:48 +00:00
|
|
|
|
|
|
|
def eq(addr)
|
|
|
|
@ip == addr.ip && @port == addr.port
|
|
|
|
end
|
2022-11-08 15:20:46 +00:00
|
|
|
end
|