Class: SendGrid::Content
- Inherits:
-
Object
- Object
- SendGrid::Content
- Defined in:
- lib/sendgrid/helpers/mail/content.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type: nil, value: nil) ⇒ Content
constructor
A new instance of Content.
- #to_json ⇒ Object
Constructor Details
#initialize(type: nil, value: nil) ⇒ Content
Returns a new instance of Content.
7 8 9 10 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 7 def initialize(type: nil, value: nil) @type = type @value = value end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 5 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 5 def value @value end |
Instance Method Details
#to_json ⇒ Object
12 13 14 15 16 17 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 12 def to_json(*) { 'type' => type, 'value' => value }.delete_if { |_, value| value.to_s.strip == '' } end |