Class: WebSocketClient::SocketByteSource
- Inherits:
-
ByteSource
- Object
- ByteSource
- WebSocketClient::SocketByteSource
- Defined in:
- lib/websocket_client/byte_source.rb
Instance Method Summary collapse
- #eof? ⇒ Boolean
- #getbyte_18 ⇒ Object
- #getbyte_19 ⇒ Object
-
#initialize(socket) ⇒ SocketByteSource
constructor
A new instance of SocketByteSource.
Methods inherited from ByteSource
Constructor Details
#initialize(socket) ⇒ SocketByteSource
Returns a new instance of SocketByteSource.
62 63 64 65 66 67 68 69 |
# File 'lib/websocket_client/byte_source.rb', line 62 def initialize(socket) @socket = socket if ( socket.respond_to? :getbyte ) alias :getbyte :getbyte_19 else alias :getbyte :getbyte_18 end end |
Instance Method Details
#eof? ⇒ Boolean
79 80 81 |
# File 'lib/websocket_client/byte_source.rb', line 79 def eof? @socket.eof? end |
#getbyte_18 ⇒ Object
71 72 73 |
# File 'lib/websocket_client/byte_source.rb', line 71 def getbyte_18 @socket.getc end |
#getbyte_19 ⇒ Object
75 76 77 |
# File 'lib/websocket_client/byte_source.rb', line 75 def getbyte_19 @socket.getbyte end |