Class: Protocol::WebSocket::TextFrame
- Defined in:
- lib/protocol/websocket/text_frame.rb
Constant Summary collapse
- OPCODE =
0x1
Instance Attribute Summary
Attributes inherited from Frame
#finished, #length, #mask, #opcode, #payload
Instance Method Summary collapse
Methods inherited from Frame
#<=>, #continued?, #control?, #finished?, #initialize, parse_header, read, #to_ary, #write
Constructor Details
This class inherits a constructor from Protocol::WebSocket::Frame
Instance Method Details
#apply(connection) ⇒ Object
36 37 38 |
# File 'lib/protocol/websocket/text_frame.rb', line 36 def apply(connection) connection.receive_text(self) end |
#pack(data, mask = @mask) ⇒ Object
32 33 34 |
# File 'lib/protocol/websocket/text_frame.rb', line 32 def pack(data, mask = @mask) super(data.b, mask = @mask) end |
#unpack ⇒ Object
28 29 30 |
# File 'lib/protocol/websocket/text_frame.rb', line 28 def unpack super.force_encoding(Encoding::UTF_8) end |