Add minor missing doc
parent
bedf7ed44b
commit
c0dab54925
|
@ -52,10 +52,17 @@ module Kademlia
|
||||||
Message.new(type, data[2, data.length])
|
Message.new(type, data[2, data.length])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Get this Message as a String
|
||||||
|
#
|
||||||
|
# @return [String] the string representation of this Message
|
||||||
def to_str
|
def to_str
|
||||||
[STANDARD_PACKET, @type].pack('CC') + @body
|
[STANDARD_PACKET, @type].pack('CC') + @body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Compares this Message and another Message for equality
|
||||||
|
#
|
||||||
|
# @param other [Message] the Message to compare
|
||||||
|
# @return [Boolean] true iff the two messages have equal types and bodies, false otherwise
|
||||||
def ==(other)
|
def ==(other)
|
||||||
type == other.type && body == other.body
|
type == other.type && body == other.body
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,6 +29,9 @@ module Kademlia
|
||||||
Pong.new(message.body.unpack('v')[0])
|
Pong.new(message.body.unpack('v')[0])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Get this Pong as a String
|
||||||
|
#
|
||||||
|
# @return [String] the string representation of this Pong
|
||||||
def to_str
|
def to_str
|
||||||
super + [@port].pack('v')
|
super + [@port].pack('v')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue