Add minor missing doc
parent
bedf7ed44b
commit
c0dab54925
|
@ -52,10 +52,17 @@ module Kademlia
|
|||
Message.new(type, data[2, data.length])
|
||||
end
|
||||
|
||||
# Get this Message as a String
|
||||
#
|
||||
# @return [String] the string representation of this Message
|
||||
def to_str
|
||||
[STANDARD_PACKET, @type].pack('CC') + @body
|
||||
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)
|
||||
type == other.type && body == other.body
|
||||
end
|
||||
|
|
|
@ -29,6 +29,9 @@ module Kademlia
|
|||
Pong.new(message.body.unpack('v')[0])
|
||||
end
|
||||
|
||||
# Get this Pong as a String
|
||||
#
|
||||
# @return [String] the string representation of this Pong
|
||||
def to_str
|
||||
super + [@port].pack('v')
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue