Class: WebSocket::Frame::Outgoing
- Defined in:
- lib/websocket/frame/outgoing.rb,
lib/websocket/frame/outgoing/client.rb,
lib/websocket/frame/outgoing/server.rb
Overview
Note:
You should NEVER use this class directly - use Client or Server subclasses instead, as they contain additional frame options(i.e. Client-side masking in draft 04)
Construct or parse outgoing WebSocket Frame.
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from Base
#code, #data, #error, #type, #version
Attributes included from ExceptionHandler
Instance Method Summary collapse
-
#require_sending? ⇒ Boolean
Should current frame be sent? Exclude empty frames etc.
-
#supported? ⇒ Boolean
Is selected type supported by current draft version?.
-
#to_s ⇒ Object
Return raw frame formatted for sending.
Methods inherited from Base
#error?, #initialize, #support_type?, #supported_frames
Methods included from NiceInspect
Methods included from ExceptionHandler
Constructor Details
This class inherits a constructor from WebSocket::Frame::Base
Instance Method Details
#require_sending? ⇒ Boolean
Should current frame be sent? Exclude empty frames etc.
23 24 25 |
# File 'lib/websocket/frame/outgoing.rb', line 23 def require_sending? !error? end |
#supported? ⇒ Boolean
Is selected type supported by current draft version?
17 18 19 |
# File 'lib/websocket/frame/outgoing.rb', line 17 def supported? support_type? end |
#to_s ⇒ Object
Return raw frame formatted for sending.
28 29 30 31 |
# File 'lib/websocket/frame/outgoing.rb', line 28 def to_s raise WebSocket::Error::Frame::UnknownFrameType unless supported? @handler.encode_frame end |