Class: Protocol::WebSocket::Message
- Inherits:
-
Object
- Object
- Protocol::WebSocket::Message
show all
- Defined in:
- lib/protocol/websocket/message.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(buffer) ⇒ Message
11
12
13
|
# File 'lib/protocol/websocket/message.rb', line 11
def initialize(buffer)
@buffer = buffer
end
|
Instance Attribute Details
#buffer ⇒ Object
Returns the value of attribute buffer.
15
16
17
|
# File 'lib/protocol/websocket/message.rb', line 15
def buffer
@buffer
end
|
Instance Method Details
#==(other) ⇒ Object
This can be helpful for writing tests.
22
23
24
|
# File 'lib/protocol/websocket/message.rb', line 22
def == other
@buffer == other.to_str
end
|
#encoding ⇒ Object
30
31
32
|
# File 'lib/protocol/websocket/message.rb', line 30
def encoding
@buffer.encoding
end
|
#size ⇒ Object
17
18
19
|
# File 'lib/protocol/websocket/message.rb', line 17
def size
@buffer.bytesize
end
|
#to_str ⇒ Object
26
27
28
|
# File 'lib/protocol/websocket/message.rb', line 26
def to_str
@buffer
end
|