Class List Method List File List

# Class: VertxUnit::EventBusCollector

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

## Class Method Summary (collapse)

- + (Object) create(vertx = nil, reporter = nil)

## Instance Method Summary (collapse)

- - (EventBusCollector) initialize(j_del) constructor
  A new instance of EventBusCollector.
- - (Object) j_del
- - (Object) register(address = nil)

## Constructor Details

### - (`EventBusCollector`) initialize(j_del)

Returns a new instance of EventBusCollector

    12
    13
    14
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/event_bus_collector.rb', line 12

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(vertx = nil, reporter = nil)

Raises:

- (`ArgumentError`)

    23
    24
    25
    26
    27
    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/event_bus_collector.rb', line 23

    def self.create(vertx=nil,reporter=nil)
      if vertx.class.method_defined?(:j_del) && reporter.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtUnitCollect::EventBusCollector.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtUnitReport::ReportingOptions.java_class]).call(vertx.j_del,Java::IoVertxExtUnitReport::ReportingOptions.new(::Vertx::Util::Utils.to_json_object(reporter))),::VertxUnit::EventBusCollector)
      elsif vertx.class.method_defined?(:j_del) && block_given? && reporter == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtUnitCollect::EventBusCollector.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCore::Handler.java_class]).call(vertx.j_del,(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestSuiteReport)) })),::VertxUnit::EventBusCollector)
      end
      raise ArgumentError, "Invalid arguments when calling create(vertx,reporter)"
    end

## Instance Method Details

### - (`Object`) j_del

    17
    18
    19
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/event_bus_collector.rb', line 17

    def j_del
      @j_del
    end

### - (`Object`) register(address = nil)

Raises:

- (`ArgumentError`)

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

    def register(address=nil)
      if address.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:register, [Java::java.lang.String.java_class]).call(address),::Vertx::MessageConsumer)
      end
      raise ArgumentError, "Invalid arguments when calling register(address)"
    end