Class: SendGrid::SubscriptionTracking

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

Instance Method Summary collapse

Constructor Details

#initialize(enable: nil, text: nil, html: nil, substitution_tag: nil) ⇒ SubscriptionTracking


78
79
80
81
82
83
# File 'lib/sendgrid/helpers/mail/mail.rb', line 78

def initialize(enable: nil, text: nil, html: nil, substitution_tag: nil)
  @enable = enable
  @text = text
  @html = html
  @substitution_tag = substitution_tag
end

Instance Method Details

#enableObject


89
90
91
# File 'lib/sendgrid/helpers/mail/mail.rb', line 89

def enable
  @enable
end

#enable=(enable) ⇒ Object


85
86
87
# File 'lib/sendgrid/helpers/mail/mail.rb', line 85

def enable=(enable)
  @enable = enable
end

#htmlObject


105
106
107
# File 'lib/sendgrid/helpers/mail/mail.rb', line 105

def html
  @html
end

#html=(html) ⇒ Object


101
102
103
# File 'lib/sendgrid/helpers/mail/mail.rb', line 101

def html=(html)
  @html = html
end

#substitution_tagObject


113
114
115
# File 'lib/sendgrid/helpers/mail/mail.rb', line 113

def substitution_tag
  @substitution_tag
end

#substitution_tag=(substitution_tag) ⇒ Object


109
110
111
# File 'lib/sendgrid/helpers/mail/mail.rb', line 109

def substitution_tag=(substitution_tag)
  @substitution_tag = substitution_tag
end

#textObject


97
98
99
# File 'lib/sendgrid/helpers/mail/mail.rb', line 97

def text
  @text
end

#text=(text) ⇒ Object


93
94
95
# File 'lib/sendgrid/helpers/mail/mail.rb', line 93

def text=(text)
  @text = text
end

#to_jsonObject


117
118
119
120
121
122
123
124
# File 'lib/sendgrid/helpers/mail/mail.rb', line 117

def to_json(*)
  {
    'enable' => self.enable,
    'text' => self.text,
    'html' => self.html,
    'substitution_tag' => self.substitution_tag
  }.delete_if { |_, value| value.to_s.strip == '' }
end