Class List Method List File List

# Class: VertxUnit::Completion

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

## Direct Known Subclasses

Async, TestCompletion

## Instance Method Summary (collapse)

- - (Object) await(timeoutMillis = nil)
- - (Object) await_success(timeoutMillis = nil)
- - (Boolean) completed?
- - (Boolean) failed?
- - (Object) handler
- - (Completion) initialize(j_del) constructor
  A new instance of Completion.
- - (Object) j_del
- - (Object) resolve(future = nil)
- - (Boolean) succeeded?

## Constructor Details

### - (`Completion`) initialize(j_del)

Returns a new instance of Completion

    9
    10
    11
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/completion.rb', line 9

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) await(timeoutMillis = nil)

Raises:

- (`ArgumentError`)

    61
    62
    63
    64
    65
    66
    67
    68
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/completion.rb', line 61

    def await(timeoutMillis=nil)
      if !block_given? && timeoutMillis == nil
        return @j_del.java_method(:await, []).call()
      elsif timeoutMillis.class == Fixnum && !block_given?
        return @j_del.java_method(:await, [Java::long.java_class]).call(timeoutMillis)
      end
      raise ArgumentError, "Invalid arguments when calling await(timeoutMillis)"
    end

### - (`Object`) await_success(timeoutMillis = nil)

Raises:

- (`ArgumentError`)

    74
    75
    76
    77
    78
    79
    80
    81
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/completion.rb', line 74

    def await_success(timeoutMillis=nil)
      if !block_given? && timeoutMillis == nil
        return @j_del.java_method(:awaitSuccess, []).call()
      elsif timeoutMillis.class == Fixnum && !block_given?
        return @j_del.java_method(:awaitSuccess, [Java::long.java_class]).call(timeoutMillis)
      end
      raise ArgumentError, "Invalid arguments when calling await_success(timeoutMillis)"
    end

### - (`Boolean`) completed?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

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

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

### - (`Boolean`) failed?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    41
    42
    43
    44
    45
    46
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/completion.rb', line 41

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

### - (`Object`) handler

Raises:

- (`ArgumentError`)

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

    def handler
      if block_given?
        return @j_del.java_method(:handler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.from_object(ar.result) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling handler()"
    end

### - (`Object`) j_del

    14
    15
    16
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/completion.rb', line 14

    def j_del
      @j_del
    end

### - (`Object`) resolve(future = nil)

Raises:

- (`ArgumentError`)

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

    def resolve(future=nil)
      if future.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:resolve, [Java::IoVertxCore::Future.java_class]).call(future.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling resolve(future)"
    end

### - (`Boolean`) succeeded?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    34
    35
    36
    37
    38
    39
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/completion.rb', line 34

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