Class: SendGrid::Category

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil) ⇒ Category

Returns a new instance of Category.



5
6
7
# File 'lib/sendgrid/helpers/mail/category.rb', line 5

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

Instance Attribute Details

#nameObject Also known as: category

Returns the value of attribute name.



3
4
5
# File 'lib/sendgrid/helpers/mail/category.rb', line 3

def name
  @name
end

Instance Method Details

#to_jsonObject



9
10
11
12
13
# File 'lib/sendgrid/helpers/mail/category.rb', line 9

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