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 incoming WebSocket Frame.
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from Base
#data, #error, #type, #version
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, #inspect, #support_type?, #supported_frames
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.
22 23 24 |
# File 'lib/websocket/frame/outgoing.rb', line 22 def require_sending? !error? end |
#supported? ⇒ Boolean
Is selected type supported by current draft version?
16 17 18 |
# File 'lib/websocket/frame/outgoing.rb', line 16 def supported? support_type? end |
#to_s ⇒ Object
Return raw frame formatted for sending.
27 28 29 30 |
# File 'lib/websocket/frame/outgoing.rb', line 27 def to_s set_error(:unknown_frame_type) and return unless supported? encode_frame end |