Class: SendGrid::Content

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

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, value: nil) ⇒ Content

Returns a new instance of Content.


642
643
644
645
# File 'lib/sendgrid/helpers/mail/mail.rb', line 642

def initialize(type: nil, value: nil)
  @type = type
  @value = value
end

Instance Method Details

#to_jsonObject


663
664
665
666
667
668
# File 'lib/sendgrid/helpers/mail/mail.rb', line 663

def to_json(*)
  {
    'type' => self.type,
    'value' => self.value
  }.delete_if { |_, value| value.to_s.strip == '' }
end

#typeObject


651
652
653
# File 'lib/sendgrid/helpers/mail/mail.rb', line 651

def type
  @type
end

#type=(type) ⇒ Object


647
648
649
# File 'lib/sendgrid/helpers/mail/mail.rb', line 647

def type=(type)
  @type = type
end

#valueObject


659
660
661
# File 'lib/sendgrid/helpers/mail/mail.rb', line 659

def value
  @value
end

#value=(value) ⇒ Object


655
656
657
# File 'lib/sendgrid/helpers/mail/mail.rb', line 655

def value=(value)
  @value = value
end