Class: VertxShell::Tty

Inherits:
Object
  • 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.

Direct Known Subclasses

CommandProcess, Term

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


18
19
20
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 18

def @@j_api_type.accept?(obj)
  obj.class == Tty
end

+ (Object) j_api_type



27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 27

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 30

def self.j_class
  Java::IoVertxExtShellTerm::Tty.java_class
end

+ (Object) unwrap(obj)



24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 24

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



21
22
23
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 21

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

Returns:

  • (Fixnum)
    the current height, i.e the number of columns or if unknown


104
105
106
107
108
109
110
111
112
113
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 104

def height
  if !block_given?
    return @j_del.java_method(:height, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling height()"
  end
end

- (self) resizehandler(handler) { ... }

Set a resize handler, the handler is called when the tty size changes.

Yields:

  • the resize handler

Returns:

  • (self)


91
92
93
94
95
96
97
98
99
100
101
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 91

def resizehandler
  if true
    @j_del.java_method(:resizehandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resizehandler()"
  end
end

- (self) stdinHandler(handler) { ... }

Set a stream handler on the standard input to read the data.

Yields:

  • the standard input

Returns:

  • (self)


37
38
39
40
41
42
43
44
45
46
47
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 37

def stdin_handler
  if true
    @j_del.java_method(:stdinHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling stdin_handler()"
  end
end

- (String) type

Returns the declared tty type, for instance , , etc... it can be null when the tty does not have declared its type.

Returns:

  • (String)
    the declared tty type, for instance , , etc... it can be null when the tty does not have declared its type.


62
63
64
65
66
67
68
69
70
71
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 62

def type
  if !block_given?
    return @j_del.java_method(:type, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling type()"
  end
end

- (Fixnum) width

Returns the current width, i.e the number of rows or if unknown

Returns:

  • (Fixnum)
    the current width, i.e the number of rows or if unknown


50
51
52
53
54
55
56
57
58
59
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 50

def width
  if !block_given?
    return @j_del.java_method(:width, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling width()"
  end
end

- (self) write(data)

Write data to the standard output.

Parameters:

  • data (String)
    the data to write

Returns:

  • (self)


76
77
78
79
80
81
82
83
84
85
86
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/tty.rb', line 76

def write(*args)
  if args[0].class == String && !block_given?
    @j_del.java_method(:write, [Java::java.lang.String.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling write(#{args[0]})"
  end
end