Class: WebSocketClient::TextFrame

Inherits:
Object
  • Object
show all
Defined in:
lib/websocket_client/frame_io.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ TextFrame

Returns a new instance of TextFrame.



11
12
13
# File 'lib/websocket_client/frame_io.rb', line 11

def initialize(text)
  @text = text
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



9
10
11
# File 'lib/websocket_client/frame_io.rb', line 9

def text
  @text
end

Instance Method Details

#bytesObject



19
20
21
# File 'lib/websocket_client/frame_io.rb', line 19

def bytes
  [ 0x00, @text.bytes.to_a, 0xFF ].flatten
end

#typeObject



15
16
17
# File 'lib/websocket_client/frame_io.rb', line 15

def type
  :text
end