Class: SendGrid::Category

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

Instance Method Summary collapse

Constructor Details

#initialize(name: nil) ⇒ Category

Returns a new instance of Category.


478
479
480
# File 'lib/sendgrid/helpers/mail/mail.rb', line 478

def initialize(name: nil)
  @category = name
end

Instance Method Details

#categoryObject


486
487
488
# File 'lib/sendgrid/helpers/mail/mail.rb', line 486

def category
  @category
end

#category=(category) ⇒ Object


482
483
484
# File 'lib/sendgrid/helpers/mail/mail.rb', line 482

def category=(category)
  @category = category
end

#to_jsonObject


490
491
492
493
494
# File 'lib/sendgrid/helpers/mail/mail.rb', line 490

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