Class: WebSocketClient::ArrayByteSource
- Inherits:
-
ByteSource
- Object
- ByteSource
- WebSocketClient::ArrayByteSource
- Defined in:
- lib/websocket_client/byte_source.rb
Instance Method Summary collapse
- #eof? ⇒ Boolean
- #getbyte ⇒ Object
-
#initialize(array) ⇒ ArrayByteSource
constructor
A new instance of ArrayByteSource.
Methods inherited from ByteSource
Constructor Details
#initialize(array) ⇒ ArrayByteSource
86 87 88 89 |
# File 'lib/websocket_client/byte_source.rb', line 86 def initialize(array) @array = array @cur = 0 end |
Instance Method Details
#eof? ⇒ Boolean
97 98 99 |
# File 'lib/websocket_client/byte_source.rb', line 97 def eof? ( @cur >= @array.size ) end |
#getbyte ⇒ Object
91 92 93 94 95 |
# File 'lib/websocket_client/byte_source.rb', line 91 def getbyte b = @array[@cur] @cur += 1 b end |