Class: VertxMail::MailAttachment

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb

Overview

Represent a mail attachment that can be used in a MailMessage.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


19
20
21
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 19

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

+ (::VertxMail::MailAttachment) create + (::VertxMail::MailAttachment) create(json) + (::VertxMail::MailAttachment) create(other)

create a copy of a MailAttachment object

Overloads:

Returns:

Raises:

  • (ArgumentError)


41
42
43
44
45
46
47
48
49
50
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 41

def self.create(param_1=nil)
  if !block_given? && param_1 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMail::MailAttachment.java_method(:create, []).call(),::VertxMail::MailAttachment)
  elsif param_1.class == Hash && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMail::MailAttachment.java_method(:create, [Java::IoVertxCoreJson::JsonObject.java_class]).call(::Vertx::Util::Utils.to_json_object(param_1)),::VertxMail::MailAttachment)
  elsif param_1.class.method_defined?(:j_del) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtMail::MailAttachment.java_method(:create, [Java::IoVertxExtMail::MailAttachment.java_class]).call(param_1.j_del),::VertxMail::MailAttachment)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{param_1})"
end

+ (Object) j_api_type



28
29
30
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 28

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



31
32
33
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 31

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

+ (Object) unwrap(obj)



25
26
27
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 25

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

+ (Object) wrap(obj)



22
23
24
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 22

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

Instance Method Details

- (self) add_header(key = nil, value = nil)

Add an header to this attachment.

Parameters:

  • key (String) (defaults to: nil)
    the header key
  • value (String) (defaults to: nil)
    the header value

Returns:

  • (self)

Raises:

  • (ArgumentError)


163
164
165
166
167
168
169
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 163

def add_header(key=nil,value=nil)
  if key.class == String && value.class == String && !block_given?
    @j_del.java_method(:addHeader, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(key,value)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_header(#{key},#{value})"
end

- (String) get_content_id

get the Content-ID field

Returns:

  • (String)
    the content id

Raises:

  • (ArgumentError)


143
144
145
146
147
148
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 143

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

- (String) get_content_type

get the Content-Type

Returns:

  • (String)
    the contentType

Raises:

  • (ArgumentError)


89
90
91
92
93
94
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 89

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

- (::Vertx::Buffer) get_data

get the data

Returns:

Raises:

  • (ArgumentError)


53
54
55
56
57
58
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 53

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

- (String) get_description

get the description field

Returns:

  • (String)
    the description

Raises:

  • (ArgumentError)


125
126
127
128
129
130
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 125

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

- (String) get_disposition

get the disposition field

Returns:

  • (String)
    the disposition

Raises:

  • (ArgumentError)


107
108
109
110
111
112
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 107

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

- (::Vertx::MultiMap) get_headers

Get the headers to be added for this attachment.

Returns:

Raises:

  • (ArgumentError)


172
173
174
175
176
177
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 172

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

- (String) get_name

get the name

Returns:

  • (String)
    the name

Raises:

  • (ArgumentError)


71
72
73
74
75
76
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 71

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

- (self) set_content_id(contentId = nil)

set the Content-ID field to be used in the attachment

Parameters:

  • contentId (String) (defaults to: nil)
    the content id

Returns:

  • (self)

Raises:

  • (ArgumentError)


152
153
154
155
156
157
158
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 152

def set_content_id(contentId=nil)
  if contentId.class == String && !block_given?
    @j_del.java_method(:setContentId, [Java::java.lang.String.java_class]).call(contentId)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_content_id(#{contentId})"
end

- (self) set_content_type(contentType = nil)

set the Content-Type

Parameters:

  • contentType (String) (defaults to: nil)
    the contentType

Returns:

  • (self)

Raises:

  • (ArgumentError)


98
99
100
101
102
103
104
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 98

def set_content_type(contentType=nil)
  if contentType.class == String && !block_given?
    @j_del.java_method(:setContentType, [Java::java.lang.String.java_class]).call(contentType)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_content_type(#{contentType})"
end

- (self) set_data(data = nil)

set the data

Parameters:

  • data (::Vertx::Buffer) (defaults to: nil)
    Buffer of bytes to be used at attachment

Returns:

  • (self)

Raises:

  • (ArgumentError)


62
63
64
65
66
67
68
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 62

def set_data(data=nil)
  if data.class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:setData, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(data.j_del)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_data(#{data})"
end

- (self) set_description(description = nil)

set the description field to be used in the attachment

Parameters:

  • description (String) (defaults to: nil)
    the description

Returns:

  • (self)

Raises:

  • (ArgumentError)


134
135
136
137
138
139
140
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 134

def set_description(description=nil)
  if description.class == String && !block_given?
    @j_del.java_method(:setDescription, [Java::java.lang.String.java_class]).call(description)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_description(#{description})"
end

- (self) set_disposition(disposition = nil)

set the disposition field to be used in the attachment

Parameters:

  • disposition (String) (defaults to: nil)
    the disposition

Returns:

  • (self)

Raises:

  • (ArgumentError)


116
117
118
119
120
121
122
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 116

def set_disposition(disposition=nil)
  if disposition.class == String && !block_given?
    @j_del.java_method(:setDisposition, [Java::java.lang.String.java_class]).call(disposition)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_disposition(#{disposition})"
end

- (self) set_headers(headers = nil)

Set the headers to be added for this attachment.

Parameters:

Returns:

  • (self)

Raises:

  • (ArgumentError)


181
182
183
184
185
186
187
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 181

def set_headers(headers=nil)
  if headers.class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:setHeaders, [Java::IoVertxCore::MultiMap.java_class]).call(headers.j_del)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_headers(#{headers})"
end

- (self) set_name(name = nil)

set the name

Parameters:

  • name (String) (defaults to: nil)
    name of the attachment file

Returns:

  • (self)

Raises:

  • (ArgumentError)


80
81
82
83
84
85
86
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 80

def set_name(name=nil)
  if name.class == String && !block_given?
    @j_del.java_method(:setName, [Java::java.lang.String.java_class]).call(name)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_name(#{name})"
end

- (Hash{String => Object}) to_json

convert this object to JSON representation

Returns:

  • (Hash{String => Object})
    the JSON object

Raises:

  • (ArgumentError)


190
191
192
193
194
195
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mail/mail_attachment.rb', line 190

def to_json
  if !block_given?
    return @j_del.java_method(:toJson, []).call() != nil ? JSON.parse(@j_del.java_method(:toJson, []).call().encode) : nil
  end
  raise ArgumentError, "Invalid arguments when calling to_json()"
end