Class: SendGrid::Category
- Inherits:
-
Object
- Object
- SendGrid::Category
- Defined in:
- lib/sendgrid/helpers/mail/category.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
(also: #category)
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name: nil) ⇒ Category
constructor
A new instance of Category.
- #to_json ⇒ Object
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
#name ⇒ Object 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_json ⇒ Object
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 |