Class: SendGrid::Attachment

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid/helpers/mail/mail.rb

Instance Method Summary collapse

Constructor Details

#initializeAttachment

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

#contentObject


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_idObject


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

#dispositionObject


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

#filenameObject


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_jsonObject


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

#typeObject


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