Class List Method List File List

# Class: Vertx::Message

Inherits:
  Object
  - Object
  - Vertx::Message
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message.rb

## Instance Method Summary (collapse)

- - (Object) address
- - (Object) body
- - (Object) fail(failureCode = nil, message = nil)
- - (Object) headers
- - (Message) initialize(j_del) constructor
  A new instance of Message.
- - (Object) j_del
- - (Object) reply(message = nil, options = nil)
- - (Object) reply_address

## Constructor Details

### - (`Message`) initialize(j_del)

Returns a new instance of Message

    16
    17
    18
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message.rb', line 16

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) address

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) body

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    48
    49
    50
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message.rb', line 42

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

### - (`Object`) fail(failureCode = nil, message = nil)

Raises:

- (`ArgumentError`)

    84
    85
    86
    87
    88
    89
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message.rb', line 84

    def fail(failureCode=nil,message=nil)
      if failureCode.class == Fixnum && message.class == String && !block_given?
        return @j_del.java_method(:fail, [Java::int.java_class,Java::java.lang.String.java_class]).call(failureCode,message)
      end
      raise ArgumentError, "Invalid arguments when calling fail(failureCode,message)"
    end

### - (`Object`) headers

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) j_del

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message.rb', line 21

    def j_del
      @j_del
    end

### - (`Object`) reply(message = nil, options = nil)

Raises:

- (`ArgumentError`)

    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message.rb', line 65

    def reply(message=nil,options=nil)
      if (message.class == String  || message.class == Hash || message.class == Array || message.class == NilClass || message.class == TrueClass || message.class == FalseClass || message.class == Fixnum || message.class == Float) && !block_given? && options == nil
        return @j_del.java_method(:reply, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(message))
      elsif (message.class == String  || message.class == Hash || message.class == Array || message.class == NilClass || message.class == TrueClass || message.class == FalseClass || message.class == Fixnum || message.class == Float) && block_given? && options == nil
        return @j_del.java_method(:reply, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_object(message),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Message) : nil) }))
      elsif (message.class == String  || message.class == Hash || message.class == Array || message.class == NilClass || message.class == TrueClass || message.class == FalseClass || message.class == Fixnum || message.class == Float) && options.class == Hash && !block_given?
        return @j_del.java_method(:reply, [Java::java.lang.Object.java_class,Java::IoVertxCoreEventbus::DeliveryOptions.java_class]).call(::Vertx::Util::Utils.to_object(message),Java::IoVertxCoreEventbus::DeliveryOptions.new(::Vertx::Util::Utils.to_json_object(options)))
      elsif (message.class == String  || message.class == Hash || message.class == Array || message.class == NilClass || message.class == TrueClass || message.class == FalseClass || message.class == Fixnum || message.class == Float) && options.class == Hash && block_given?
        return @j_del.java_method(:reply, [Java::java.lang.Object.java_class,Java::IoVertxCoreEventbus::DeliveryOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_object(message),Java::IoVertxCoreEventbus::DeliveryOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Message) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling reply(message,options)"
    end

### - (`Object`) reply_address

Raises:

- (`ArgumentError`)

    53
    54
    55
    56
    57
    58
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message.rb', line 53

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