Class: SendGrid::Attachment
- Inherits:
-
Object
- Object
- SendGrid::Attachment
- Defined in:
- lib/sendgrid/helpers/mail/attachment.rb
Instance Method Summary collapse
- #content ⇒ Object
- #content=(content) ⇒ Object
- #content_id ⇒ Object
- #content_id=(content_id) ⇒ Object
- #disposition ⇒ Object
- #disposition=(disposition) ⇒ Object
- #filename ⇒ Object
- #filename=(filename) ⇒ Object
-
#initialize ⇒ Attachment
constructor
A new instance of Attachment.
- #to_json ⇒ Object
- #type ⇒ Object
- #type=(type) ⇒ Object
Constructor Details
#initialize ⇒ Attachment
Returns a new instance of Attachment.
5 6 7 8 9 10 11 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 5 def initialize @content = nil @type = nil @filename = nil @disposition = nil @content_id = nil end |
Instance Method Details
#content ⇒ Object
17 18 19 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 17 def content @content end |
#content=(content) ⇒ Object
13 14 15 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 13 def content=(content) @content = content end |
#content_id ⇒ Object
49 50 51 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 49 def content_id @content_id end |
#content_id=(content_id) ⇒ Object
45 46 47 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 45 def content_id=(content_id) @content_id = content_id end |
#disposition ⇒ Object
41 42 43 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 41 def disposition @disposition end |
#disposition=(disposition) ⇒ Object
37 38 39 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 37 def disposition=(disposition) @disposition = disposition end |
#filename ⇒ Object
33 34 35 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 33 def filename @filename end |
#filename=(filename) ⇒ Object
29 30 31 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 29 def filename=(filename) @filename = filename end |
#to_json ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 53 def to_json(*) { 'content' => self.content, 'type' => self.type, 'filename' => self.filename, 'disposition' => self.disposition, 'content_id' => self.content_id }.delete_if { |_, value| value.to_s.strip == '' } end |
#type ⇒ Object
25 26 27 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 25 def type @type end |
#type=(type) ⇒ Object
21 22 23 |
# File 'lib/sendgrid/helpers/mail/attachment.rb', line 21 def type=(type) @type = type end |