Class: VertxShell::Tty
- Inherits:
-
Object
show all
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb
Overview
Provide interactions with the Shell TTY.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary
(collapse)
Instance Method Summary
(collapse)
Class Method Details
+ (Boolean) accept?(obj)
17
18
19
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 17
def @@j_api_type.accept?(obj)
obj.class == Tty
end
|
+ (Object) j_api_type
26
27
28
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 26
def self.j_api_type
@@j_api_type
end
|
+ (Object) j_class
29
30
31
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 29
def self.j_class
Java::IoVertxExtShellTerm::Tty.java_class
end
|
+ (Object) unwrap(obj)
23
24
25
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 23
def @@j_api_type.unwrap(obj)
obj.j_del
end
|
+ (Object) wrap(obj)
20
21
22
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 20
def @@j_api_type.wrap(obj)
Tty.new(obj)
end
|
Instance Method Details
- (Fixnum) height
Returns the current height, i.e the number of columns or if unknown
47
48
49
50
51
52
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 47
def height
if !block_given?
return @j_del.java_method(:height, []).call()
end
raise ArgumentError, "Invalid arguments when calling height()"
end
|
- (self) resizehandler { ... }
Set a resize handler, the handler is called when the tty size changes.
76
77
78
79
80
81
82
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 76
def resizehandler
if block_given?
@j_del.java_method(:resizehandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
return self
end
raise ArgumentError, "Invalid arguments when calling resizehandler()"
end
|
- (self) stdin_handler { ... }
Set a stream handler on the standard input to read the data.
56
57
58
59
60
61
62
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 56
def stdin_handler
if block_given?
@j_del.java_method(:stdinHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) }))
return self
end
raise ArgumentError, "Invalid arguments when calling stdin_handler()"
end
|
- (String) type
Returns the declared tty type, for instance , , etc... it can be null when the tty does not have declared its type.
33
34
35
36
37
38
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 33
def type
if !block_given?
return @j_del.java_method(:type, []).call()
end
raise ArgumentError, "Invalid arguments when calling type()"
end
|
- (Fixnum) width
Returns the current width, i.e the number of rows or if unknown
40
41
42
43
44
45
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 40
def width
if !block_given?
return @j_del.java_method(:width, []).call()
end
raise ArgumentError, "Invalid arguments when calling width()"
end
|
- (self) write(data = nil)
Write data to the standard output.
66
67
68
69
70
71
72
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 66
def write(data=nil)
if data.class == String && !block_given?
@j_del.java_method(:write, [Java::java.lang.String.java_class]).call(data)
return self
end
raise ArgumentError, "Invalid arguments when calling write(#{data})"
end
|