Class: VertxShell::CommandResolver

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

Overview

A resolver for commands, so the shell can discover commands.

Direct Known Subclasses

CommandRegistry

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

+ (::VertxShell::CommandResolver) baseCommands(vertx)

Returns the base commands of Vert.x Shell.

Parameters:

Returns:



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

def self.base_commands(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellCommand::CommandResolver.java_method(:baseCommands, [Java::IoVertxCore::Vertx.java_class]).call(args[0].j_del),::VertxShell::CommandResolver)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling base_commands(#{args[0]})"
  end
end

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (Array<::VertxShell::Command>) commands

Returns the current commands

Returns:



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

def commands
  if !block_given?
    return @j_del.java_method(:commands, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxShell::Command) }
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling commands()"
  end
end

- (::VertxShell::Command) getCommand(name)

Returns a single command by its name.

Parameters:

  • name (String)
    the command name

Returns:



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

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