Class: TMail::MimeEncodeAuto

Inherits:
Object
  • Object
show all
Defined in:
lib/tmail/net.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(s = nil, m = nil) ⇒ MimeEncodeAuto

Returns a new instance of MimeEncodeAuto.



221
222
223
224
# File 'lib/tmail/net.rb', line 221

def initialize( s = nil, m = nil )
  @singlepart_composer = s || MimeEncodeSingle.new
  @multipart_composer  = m || MimeEncodeMulti.new
end

Instance Attribute Details

#multipart_composerObject (readonly)

Returns the value of attribute multipart_composer.



227
228
229
# File 'lib/tmail/net.rb', line 227

def multipart_composer
  @multipart_composer
end

#singlepart_composerObject (readonly)

Returns the value of attribute singlepart_composer.



226
227
228
# File 'lib/tmail/net.rb', line 226

def singlepart_composer
  @singlepart_composer
end

Instance Method Details

#exec(mail) ⇒ Object



229
230
231
232
233
# File 'lib/tmail/net.rb', line 229

def exec( mail )
  if mail._builtin_multipart?
  then @multipart_composer
  else @singlepart_composer end.exec mail
end