Class: VertxShell::Command

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command.rb

Overview

A Vert.x Shell command, it can be created from any language using the VertxShell::CommandBuilder#command or from a Java class using #create

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

+ (Object) j_api_type



32
33
34
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command.rb', line 32

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



35
36
37
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command.rb', line 35

def self.j_class
  Java::IoVertxExtShellCommand::Command.java_class
end

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

def @@j_api_type.wrap(obj)
  Command.new(obj)
end

Instance Method Details

- (::Vertx::CLI) cli

Returns the command line interface, can be null

Returns:

  • (::Vertx::CLI)
    the command line interface, can be null


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

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

- (void) complete(completion)

This method returns an undefined value.

Perform command completion, when the command is done completing it should call or )} method to signal completion is done.

Parameters:



84
85
86
87
88
89
90
91
92
93
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command.rb', line 84

def complete(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    return @j_del.java_method(:complete, [Java::IoVertxExtShellCli::Completion.java_class]).call(args[0].j_del)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling complete(#{args[0]})"
  end
end

- (::VertxShell::Process) createProcess - (::VertxShell::Process) createProcess(args)

Create a new process with the passed arguments.

Overloads:

Returns:



55
56
57
58
59
60
61
62
63
64
65
66
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command.rb', line 55

def create_process(*args)
  if !block_given? && args[0] == nil
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createProcess, []).call(),::VertxShell::Process)
  elsif args[0].class == Array && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createProcess, [Java::JavaUtil::List.java_class]).call(args[0].map { |element| element.j_del }),::VertxShell::Process)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create_process(#{args[0]})"
  end
end

- (String) name

Returns the command name

Returns:

  • (String)
    the command name


69
70
71
72
73
74
75
76
77
78
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command.rb', line 69

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