Class: PecRuby::SimpleMailAttachment

Inherits:
Object
  • Object
show all
Defined in:
lib/pec_ruby/attachment.rb

Overview

Simple wrapper for mail attachments that mimics Mail::Attachment interface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mail, filename, mime_type) ⇒ SimpleMailAttachment

Returns a new instance of SimpleMailAttachment.



205
206
207
208
209
# File 'lib/pec_ruby/attachment.rb', line 205

def initialize(mail, filename, mime_type)
  @mail = mail
  @filename = filename
  @mime_type = mime_type
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



203
204
205
# File 'lib/pec_ruby/attachment.rb', line 203

def filename
  @filename
end

#mailObject (readonly)

Returns the value of attribute mail.



203
204
205
# File 'lib/pec_ruby/attachment.rb', line 203

def mail
  @mail
end

#mime_typeObject (readonly)

Returns the value of attribute mime_type.



203
204
205
# File 'lib/pec_ruby/attachment.rb', line 203

def mime_type
  @mime_type
end

Instance Method Details

#decodedObject



211
212
213
# File 'lib/pec_ruby/attachment.rb', line 211

def decoded
  @mail.to_s
end