Class: RBGL::GUI::X11::Transport
- Inherits:
-
Object
- Object
- RBGL::GUI::X11::Transport
- Defined in:
- lib/rbgl/gui/x11/transport.rb
Instance Attribute Summary collapse
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(socket) ⇒ Transport
constructor
A new instance of Transport.
- #pending ⇒ Object
- #read(length) ⇒ Object
- #write(data) ⇒ Object
Constructor Details
#initialize(socket) ⇒ Transport
Returns a new instance of Transport.
9 10 11 |
# File 'lib/rbgl/gui/x11/transport.rb', line 9 def initialize(socket) @socket = socket end |
Instance Attribute Details
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
7 8 9 |
# File 'lib/rbgl/gui/x11/transport.rb', line 7 def socket @socket end |
Instance Method Details
#flush ⇒ Object
21 22 23 |
# File 'lib/rbgl/gui/x11/transport.rb', line 21 def flush @socket.flush end |
#pending ⇒ Object
25 26 27 |
# File 'lib/rbgl/gui/x11/transport.rb', line 25 def pending IO.select([@socket], nil, nil, 0) ? 1 : 0 end |
#read(length) ⇒ Object
17 18 19 |
# File 'lib/rbgl/gui/x11/transport.rb', line 17 def read(length) @socket.read(length) end |
#write(data) ⇒ Object
13 14 15 |
# File 'lib/rbgl/gui/x11/transport.rb', line 13 def write(data) @socket.write(data) end |