Class: SendGrid::Category
- Inherits:
-
Object
- Object
- SendGrid::Category
- Defined in:
- lib/sendgrid/helpers/mail/mail.rb
Instance Method Summary collapse
- #category ⇒ Object
- #category=(category) ⇒ Object
-
#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.
478 479 480 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 478 def initialize(name: nil) @category = name end |
Instance Method Details
#category ⇒ Object
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_json ⇒ Object
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 |