File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments