Class: Libuv::TTY
- Inherits:
-
Handle
- Object
- Q::Promise
- Q::DeferredPromise
- Handle
- Libuv::TTY
- Includes:
- Stream
- Defined in:
- lib/libuv/tty.rb
Constant Summary
Constants included from Stream
Stream::BACKLOG_ERROR, Stream::CLOSED_HANDLE_ERROR, Stream::STREAM_CLOSED_ERROR, Stream::WRITE_ERROR
Constants included from Assertions
Constants inherited from Q::Promise
Instance Attribute Summary
Attributes inherited from Handle
Instance Method Summary collapse
- #disable_raw_mode ⇒ Object
- #enable_raw_mode ⇒ Object
-
#initialize(loop, fileno, readable) ⇒ TTY
constructor
A new instance of TTY.
- #reset_mode ⇒ Object
- #winsize ⇒ Object
Methods included from Stream
included, #listen, #progress, #readable?, #shutdown, #start_read, #stop_read, #try_write, #writable?, #write
Methods inherited from Handle
#active?, #close, #closing?, #ref, #unref
Methods included from Assertions
#assert_block, #assert_boolean, #assert_type
Methods included from Resource
#check_result, #check_result!, #resolve, #to_ptr
Methods inherited from Q::DeferredPromise
Methods inherited from Q::Promise
Constructor Details
#initialize(loop, fileno, readable) ⇒ TTY
Returns a new instance of TTY.
6 7 8 9 10 11 12 13 |
# File 'lib/libuv/tty.rb', line 6 def initialize(loop, fileno, readable) @loop = loop tty_ptr = ::Libuv::Ext.allocate_handle_tty error = check_result(::Libuv::Ext.tty_init(loop.handle, tty_ptr, fileno, readable ? 1 : 0)) super(tty_ptr, error) end |
Instance Method Details
#disable_raw_mode ⇒ Object
20 21 22 23 |
# File 'lib/libuv/tty.rb', line 20 def disable_raw_mode return if @closed check_result ::Libuv::Ext.tty_set_mode(handle, 0) end |
#enable_raw_mode ⇒ Object
15 16 17 18 |
# File 'lib/libuv/tty.rb', line 15 def enable_raw_mode return if @closed check_result ::Libuv::Ext.tty_set_mode(handle, 1) end |