Class: SendGrid::Attachment
- Inherits:
-
Object
- Object
- SendGrid::Attachment
- Defined in:
- lib/sendgrid/helpers/mail/mail.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.
519 520 521 522 523 524 525 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 519 def initialize @content = nil @type = nil @filename = nil @disposition = nil @content_id = nil end |
Instance Method Details
#content ⇒ Object
531 532 533 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 531 def content @content end |
#content=(content) ⇒ Object
527 528 529 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 527 def content=(content) @content = content end |
#content_id ⇒ Object
563 564 565 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 563 def content_id @content_id end |
#content_id=(content_id) ⇒ Object
559 560 561 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 559 def content_id=(content_id) @content_id = content_id end |
#disposition ⇒ Object
555 556 557 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 555 def disposition @disposition end |
#disposition=(disposition) ⇒ Object
551 552 553 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 551 def disposition=(disposition) @disposition = disposition end |
#filename ⇒ Object
547 548 549 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 547 def filename @filename end |
#filename=(filename) ⇒ Object
543 544 545 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 543 def filename=(filename) @filename = filename end |
#to_json ⇒ Object
567 568 569 570 571 572 573 574 575 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 567 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
539 540 541 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 539 def type @type end |
#type=(type) ⇒ Object
535 536 537 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 535 def type=(type) @type = type end |