Skip to content

Commit c0dab54

Browse files
committed
Add minor missing doc
1 parent bedf7ed commit c0dab54

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/rex/proto/kademlia/message.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,17 @@ def self.from_data(data)
5252
Message.new(type, data[2, data.length])
5353
end
5454

55+
# Get this Message as a String
56+
#
57+
# @return [String] the string representation of this Message
5558
def to_str
5659
[STANDARD_PACKET, @type].pack('CC') + @body
5760
end
5861

62+
# Compares this Message and another Message for equality
63+
#
64+
# @param other [Message] the Message to compare
65+
# @return [Boolean] true iff the two messages have equal types and bodies, false otherwise
5966
def ==(other)
6067
type == other.type && body == other.body
6168
end

lib/rex/proto/kademlia/pong.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def self.from_data(data)
2929
Pong.new(message.body.unpack('v')[0])
3030
end
3131

32+
# Get this Pong as a String
33+
#
34+
# @return [String] the string representation of this Pong
3235
def to_str
3336
super + [@port].pack('v')
3437
end

0 commit comments

Comments
 (0)