File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,17 @@ def self.from_data(data)
52
52
Message . new ( type , data [ 2 , data . length ] )
53
53
end
54
54
55
+ # Get this Message as a String
56
+ #
57
+ # @return [String] the string representation of this Message
55
58
def to_str
56
59
[ STANDARD_PACKET , @type ] . pack ( 'CC' ) + @body
57
60
end
58
61
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
59
66
def ==( other )
60
67
type == other . type && body == other . body
61
68
end
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ def self.from_data(data)
29
29
Pong . new ( message . body . unpack ( 'v' ) [ 0 ] )
30
30
end
31
31
32
+ # Get this Pong as a String
33
+ #
34
+ # @return [String] the string representation of this Pong
32
35
def to_str
33
36
super + [ @port ] . pack ( 'v' )
34
37
end
You can’t perform that action at this time.
0 commit comments