From c0dab549251aec80f71ad1c5e445d160c44e9fc3 Mon Sep 17 00:00:00 2001 From: Jon Hart Date: Tue, 25 Nov 2014 07:37:49 -0800 Subject: [PATCH] Add minor missing doc --- lib/rex/proto/kademlia/message.rb | 7 +++++++ lib/rex/proto/kademlia/pong.rb | 3 +++ 2 files changed, 10 insertions(+) diff --git a/lib/rex/proto/kademlia/message.rb b/lib/rex/proto/kademlia/message.rb index 312d83e190..7393ce9257 100644 --- a/lib/rex/proto/kademlia/message.rb +++ b/lib/rex/proto/kademlia/message.rb @@ -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 diff --git a/lib/rex/proto/kademlia/pong.rb b/lib/rex/proto/kademlia/pong.rb index 5c21dfd221..d3ce9a1c76 100644 --- a/lib/rex/proto/kademlia/pong.rb +++ b/lib/rex/proto/kademlia/pong.rb @@ -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