Class: SendGrid::Content
- Inherits:
-
Object
- Object
- SendGrid::Content
- Defined in:
- lib/sendgrid/helpers/mail/content.rb
Instance Method Summary collapse
-
#initialize(type: nil, value: nil) ⇒ Content
constructor
A new instance of Content.
- #to_json ⇒ Object
- #type ⇒ Object
- #type=(type) ⇒ Object
- #value ⇒ Object
- #value=(value) ⇒ Object
Constructor Details
#initialize(type: nil, value: nil) ⇒ Content
5 6 7 8 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 5 def initialize(type: nil, value: nil) @type = type @value = value end |
Instance Method Details
#to_json ⇒ Object
26 27 28 29 30 31 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 26 def to_json(*) { 'type' => self.type, 'value' => self.value }.delete_if { |_, value| value.to_s.strip == '' } end |
#type ⇒ Object
14 15 16 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 14 def type @type end |
#type=(type) ⇒ Object
10 11 12 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 10 def type=(type) @type = type end |
#value ⇒ Object
22 23 24 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 22 def value @value end |
#value=(value) ⇒ Object
18 19 20 |
# File 'lib/sendgrid/helpers/mail/content.rb', line 18 def value=(value) @value = value end |