Class List Method List File List

# Class: VertxMail::MailClient

Inherits:
  Object
  - Object
  - VertxMail::MailClient
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mail/mail_client.rb

## Direct Known Subclasses

MailService

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxMail::MailClient) create_non_shared(vertx = nil, config = nil)
- + (::VertxMail::MailClient) create_shared(vertx = nil, config = nil, poolName = nil)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) close
- - (self) send_mail(arg0 = nil) { ... }

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

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

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

### + (`::VertxMail::MailClient`) create_non_shared(vertx = nil, config = nil)

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`)
- config (`Hash`) (defaults to: `nil`)

Returns:

- (`::VertxMail::MailClient`)

Raises:

- (`ArgumentError`)

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

    def self.create_non_shared(vertx=nil,config=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMail::MailClient.java_method(:createNonShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtMail::MailConfig.java_class]).call(vertx.j_del,Java::IoVertxExtMail::MailConfig.new(::Vertx::Util::Utils.to_json_object(config))),::VertxMail::MailClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_non_shared(#{vertx},#{config})"
    end

### + (`::VertxMail::MailClient`) create_shared(vertx = nil, config = nil, poolName = nil)

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`)
- config (`Hash`) (defaults to: `nil`)
- poolName (`String`) (defaults to: `nil`)

Returns:

- (`::VertxMail::MailClient`)

Raises:

- (`ArgumentError`)

    45
    46
    47
    48
    49
    50
    51
    52
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mail/mail_client.rb', line 45

    def self.create_shared(vertx=nil,config=nil,poolName=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given? && poolName == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMail::MailClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtMail::MailConfig.java_class]).call(vertx.j_del,Java::IoVertxExtMail::MailConfig.new(::Vertx::Util::Utils.to_json_object(config))),::VertxMail::MailClient)
      elsif vertx.class.method_defined?(:j_del) && config.class == Hash && poolName.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMail::MailClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtMail::MailConfig.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,Java::IoVertxExtMail::MailConfig.new(::Vertx::Util::Utils.to_json_object(config)),poolName),::VertxMail::MailClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_shared(#{vertx},#{config},#{poolName})"
    end

### + (`Object`) j_api_type

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

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

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

    def self.j_class
      Java::IoVertxExtMail::MailClient.java_class
    end

### + (`Object`) unwrap(obj)

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

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

### + (`Object`) wrap(obj)

    20
    21
    22
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mail/mail_client.rb', line 20

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

## Instance Method Details

### - (`void`) close

This method returns an undefined value.

Raises:

- (`ArgumentError`)

    64
    65
    66
    67
    68
    69
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mail/mail_client.rb', line 64

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

### - (`self`) send_mail(arg0 = nil) { ... }

Parameters:

- arg0 (`Hash`) (defaults to: `nil`)

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

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

    def send_mail(arg0=nil)
      if arg0.class == Hash && block_given?
        @j_del.java_method(:sendMail, [Java::IoVertxExtMail::MailMessage.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxExtMail::MailMessage.new(::Vertx::Util::Utils.to_json_object(arg0)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling send_mail(#{arg0})"
    end