Class: AppMail::Attachment
- Inherits:
-
Object
- Object
- AppMail::Attachment
- Defined in:
- lib/app_mail/attachment.rb
Instance Method Summary collapse
- #content_type ⇒ Object
- #data ⇒ Object
- #filename ⇒ Object
- #hash ⇒ Object
-
#initialize(attributes) ⇒ Attachment
constructor
A new instance of Attachment.
- #size ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Attachment
Returns a new instance of Attachment.
6 7 8 |
# File 'lib/app_mail/attachment.rb', line 6 def initialize(attributes) @attributes = attributes end |
Instance Method Details
#content_type ⇒ Object
14 15 16 |
# File 'lib/app_mail/attachment.rb', line 14 def content_type @attributes['content_type'] end |
#data ⇒ Object
26 27 28 |
# File 'lib/app_mail/attachment.rb', line 26 def data @data ||= Base64.decode64(@attributes['data']) end |
#filename ⇒ Object
10 11 12 |
# File 'lib/app_mail/attachment.rb', line 10 def filename @attributes['filename'] end |
#hash ⇒ Object
22 23 24 |
# File 'lib/app_mail/attachment.rb', line 22 def hash @attributes['hash'] end |
#size ⇒ Object
18 19 20 |
# File 'lib/app_mail/attachment.rb', line 18 def size @attributes['size'] end |