Class: VertxShell::Completion

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

Overview

The completion object

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-stack/stack-docs/target/rb/vertx-shell/completion.rb', line 20

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

def self.j_class
  Java::IoVertxExtShellCli::Completion.java_class
end

+ (Object) unwrap(obj)



26
27
28
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/completion.rb', line 26

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

+ (Object) wrap(obj)



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

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

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)


70
71
72
73
74
75
76
77
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/completion.rb', line 70

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

Returns the current line being completed as preparsed tokens

Returns:

Raises:

  • (ArgumentError)


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

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

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

Returns:

  • (String)
    the current line being completed in raw format, i.e without any char escape performed

Raises:

  • (ArgumentError)


50
51
52
53
54
55
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/completion.rb', line 50

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

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

Returns:

  • (::VertxShell::Session)
    the shell current session, useful for accessing data like the current path for file completion, etc...

Raises:

  • (ArgumentError)


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

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

Returns the current Vert.x instance

Returns:

Raises:

  • (ArgumentError)


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

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