Class List Method List File List

# Class: VertxShell::Completion

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

## Overview

The completion object

## Instance Method Summary (collapse)

- - (void) complete(param_1 = nil, param_2 = nil)
  End the completion with a value that will be inserted to complete the line.
- - (Array<::VertxShell::CliToken>) line_tokens
  @return the current line being completed as preparsed tokens.
- - (String) raw_line
  @return the current line being completed in raw format, i.e without any char escape performed.
- - (::VertxShell::Session) session
  @return the shell current session, useful for accessing data like the current path for file completion, etc...
- - (::Vertx::Vertx) vertx
  @return the current Vert.x instance.

## Instance Method Details

### - (`void`) complete(candidates) - (`void`) complete(value, terminal)

This method returns an undefined value.

End the completion with a value that will be inserted to complete the line.

Overloads:

- - (`void`) complete(candidates)

  Parameters:

  - candidates (`Array<String>`) —
    the candidates
- - (`void`) complete(value, terminal)

  Parameters:

  - value (`String`) —
    the value to complete with
  - terminal (`true`, `false`) —
    true if the value is terminal, i.e can be further completed

Raises:

- (`ArgumentError`)

    58
    59
    60
    61
    62
    63
    64
    65
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/completion.rb', line 58

    def complete(param_1=nil,param_2=nil)
      if param_1.class == Array && !block_given? && param_2 == nil
        return @j_del.java_method(:complete, [Java::JavaUtil::List.java_class]).call(param_1.map { |element| element })
      elsif param_1.class == String && (param_2.class == TrueClass || param_2.class == FalseClass) && !block_given?
        return @j_del.java_method(:complete, [Java::java.lang.String.java_class,Java::boolean.java_class]).call(param_1,param_2)
      end
      raise ArgumentError, "Invalid arguments when calling complete(param_1,param_2)"
    end

### - (`Array<::VertxShell::CliToken>`) line_tokens

@return the current line being completed as preparsed tokens

Returns:

- (`Array<::VertxShell::CliToken>`)

Raises:

- (`ArgumentError`)

    45
    46
    47
    48
    49
    50
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/completion.rb', line 45

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

### - (`String`) raw_line

@return the current line being completed in raw format, i.e without any char escape performed

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

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

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

### - (`::VertxShell::Session`) session

@return the shell current session, useful for accessing data like the current path for file completion, etc...

Returns:

- (`::VertxShell::Session`)

Raises:

- (`ArgumentError`)

    29
    30
    31
    32
    33
    34
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/completion.rb', line 29

    def session
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:session, []).call(),::VertxShell::Session)
      end
      raise ArgumentError, "Invalid arguments when calling session()"
    end

### - (`::Vertx::Vertx`) vertx

@return the current Vert.x instance

Returns:

- (`::Vertx::Vertx`)

Raises:

- (`ArgumentError`)

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

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