Class: Lich::Common::WebSocket::Frame::Message
- Inherits:
-
Struct
- Object
- Struct
- Lich::Common::WebSocket::Frame::Message
- Defined in:
- documented/common/websocket/frame.rb
Overview
A single reassembled message (data: :text/:binary with any continuation frames already merged; control: :close/:ping/:pong, always a single frame per RFC 6455 5.5).
Instance Attribute Summary collapse
-
#opcode ⇒ Object
Returns the value of attribute opcode.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
-
#control? ⇒ Boolean
Returns true if this message is a control frame (close, ping, or pong).
-
#data? ⇒ Boolean
Returns true if this message is a data frame (text or binary), excluding continuation frames.
Instance Attribute Details
#opcode ⇒ Object
Returns the value of attribute opcode
44 45 46 |
# File 'documented/common/websocket/frame.rb', line 44 def opcode @opcode end |
#payload ⇒ Object
Returns the value of attribute payload
44 45 46 |
# File 'documented/common/websocket/frame.rb', line 44 def payload @payload end |
Instance Method Details
#control? ⇒ Boolean
Returns true if this message is a control frame (close, ping, or pong).
55 56 57 |
# File 'documented/common/websocket/frame.rb', line 55 def control? CONTROL_OPCODES.include?(opcode) end |
#data? ⇒ Boolean
Returns true if this message is a data frame (text or binary), excluding continuation frames.
48 49 50 |
# File 'documented/common/websocket/frame.rb', line 48 def data? DATA_OPCODES.include?(opcode) && opcode != OPCODE_CONTINUATION end |