Class List Method List File List

# Class: VertxShell::CommandResolver

Inherits:
  Object
  - Object
  - VertxShell::CommandResolver
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/command_resolver.rb

## Direct Known Subclasses

CommandRegistry

## Class Method Summary (collapse)

- + (Object) base_commands(vertx = nil)

## Instance Method Summary (collapse)

- - (Object) commands
- - (Object) get_command(name = nil)
- - (CommandResolver) initialize(j_del) constructor
  A new instance of CommandResolver.
- - (Object) j_del

## Constructor Details

### - (`CommandResolver`) initialize(j_del)

Returns a new instance of CommandResolver

    10
    11
    12
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/command_resolver.rb', line 10

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) base_commands(vertx = nil)

Raises:

- (`ArgumentError`)

    20
    21
    22
    23
    24
    25
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/command_resolver.rb', line 20

    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

## Instance Method Details

### - (`Object`) commands

Raises:

- (`ArgumentError`)

    27
    28
    29
    30
    31
    32
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/command_resolver.rb', line 27

    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

### - (`Object`) get_command(name = nil)

Raises:

- (`ArgumentError`)

    36
    37
    38
    39
    40
    41
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/command_resolver.rb', line 36

    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

### - (`Object`) j_del

    15
    16
    17
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/command_resolver.rb', line 15

    def j_del
      @j_del
    end