Class: Mailtrap::Attachment
- Inherits:
-
Object
- Object
- Mailtrap::Attachment
- Defined in:
- lib/mailtrap/attachment.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#content_id ⇒ Object
Returns the value of attribute content_id.
-
#disposition ⇒ Object
Returns the value of attribute disposition.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(content:, filename:, type: nil, disposition: nil, content_id: nil) ⇒ Attachment
constructor
A new instance of Attachment.
Constructor Details
#initialize(content:, filename:, type: nil, disposition: nil, content_id: nil) ⇒ Attachment
Returns a new instance of Attachment.
11 12 13 14 15 16 17 |
# File 'lib/mailtrap/attachment.rb', line 11 def initialize(content:, filename:, type: nil, disposition: nil, content_id: nil) self.content = content @type = type @filename = filename @disposition = disposition @content_id = content_id end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
9 10 11 |
# File 'lib/mailtrap/attachment.rb', line 9 def content @content end |
#content_id ⇒ Object
Returns the value of attribute content_id.
8 9 10 |
# File 'lib/mailtrap/attachment.rb', line 8 def content_id @content_id end |
#disposition ⇒ Object
Returns the value of attribute disposition.
8 9 10 |
# File 'lib/mailtrap/attachment.rb', line 8 def disposition @disposition end |
#filename ⇒ Object
Returns the value of attribute filename.
8 9 10 |
# File 'lib/mailtrap/attachment.rb', line 8 def filename @filename end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/mailtrap/attachment.rb', line 8 def type @type end |
Instance Method Details
#as_json ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/mailtrap/attachment.rb', line 19 def as_json { 'content' => content, 'type' => type, 'filename' => filename, 'disposition' => disposition, 'content_id' => content_id }.compact end |