Class: VertxShell::CommandResolver
- Inherits:
-
Object
- Object
- VertxShell::CommandResolver
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.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary
(collapse)
Instance Method Summary
(collapse)
Class Method Details
+ (Boolean) accept?(obj)
19
20
21
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_resolver.rb', line 19
def @@j_api_type.accept?(obj)
obj.class == CommandResolver
end
|
Returns the base commands of Vert.x Shell.
36
37
38
39
40
41
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_resolver.rb', line 36
def self.base_commands(vertx=nil)
if vertx.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(vertx.j_del),::VertxShell::CommandResolver)
end
raise ArgumentError, "Invalid arguments when calling base_commands(#{vertx})"
end
|
+ (Object) j_api_type
28
29
30
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_resolver.rb', line 28
def self.j_api_type
@@j_api_type
end
|
+ (Object) j_class
31
32
33
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_resolver.rb', line 31
def self.j_class
Java::IoVertxExtShellCommand::CommandResolver.java_class
end
|
+ (Object) unwrap(obj)
25
26
27
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_resolver.rb', line 25
def @@j_api_type.unwrap(obj)
obj.j_del
end
|
+ (Object) wrap(obj)
22
23
24
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_resolver.rb', line 22
def @@j_api_type.wrap(obj)
CommandResolver.new(obj)
end
|
Instance Method Details
Returns the current commands
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 43
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
raise ArgumentError, "Invalid arguments when calling commands()"
end
|
Returns a single command by its name.
52
53
54
55
56
57
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/command_resolver.rb', line 52
def get_command(name=nil)
if name.class == String && !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getCommand, [Java::java.lang.String.java_class]).call(name),::VertxShell::Command)
end
raise ArgumentError, "Invalid arguments when calling get_command(#{name})"
end
|