Class: OpenHAB::Console::Stdio
- Inherits:
-
Object
- Object
- OpenHAB::Console::Stdio
- Defined in:
- lib/openhab/console/stdio.rb
Instance Attribute Summary collapse
-
#internal_encoding ⇒ Object
readonly
Returns the value of attribute internal_encoding.
Instance Method Summary collapse
-
#initialize(terminal) ⇒ Stdio
constructor
A new instance of Stdio.
- #inspect ⇒ Object
- #set_encoding(_external, internal = nil, _options = {}) ⇒ Object
- #tty? ⇒ Boolean
- #winsize ⇒ Object
Constructor Details
#initialize(terminal) ⇒ Stdio
Returns a new instance of Stdio.
12 13 14 15 |
# File 'lib/openhab/console/stdio.rb', line 12 def initialize(terminal) @terminal = terminal @external_encoding = Encoding.find(@terminal.encoding.name) end |
Instance Attribute Details
#internal_encoding ⇒ Object (readonly)
Returns the value of attribute internal_encoding.
10 11 12 |
# File 'lib/openhab/console/stdio.rb', line 10 def internal_encoding @internal_encoding end |
Instance Method Details
#inspect ⇒ Object
29 30 31 |
# File 'lib/openhab/console/stdio.rb', line 29 def inspect "#<#{self.class}>" end |
#set_encoding(_external, internal = nil, _options = {}) ⇒ Object
17 18 19 |
# File 'lib/openhab/console/stdio.rb', line 17 def set_encoding(_external, internal = nil, = {}) @internal_encoding = internal end |
#tty? ⇒ Boolean
21 22 23 |
# File 'lib/openhab/console/stdio.rb', line 21 def tty? true end |
#winsize ⇒ Object
25 26 27 |
# File 'lib/openhab/console/stdio.rb', line 25 def winsize [@terminal.height, @terminal.width] end |