teeworlds_network/lib/models/net_addr.rb

19 lines
243 B
Ruby
Raw Normal View History

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
def to_s
"#{@ip}:#{@port}"
end
def eq(addr)
@ip == addr.ip && @port == addr.port
end
2022-11-08 15:20:46 +00:00
end