Class: SendGrid::OpenTracking

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

Instance Method Summary collapse

Constructor Details

#initialize(enable: nil, substitution_tag: nil) ⇒ OpenTracking

Returns a new instance of OpenTracking.


128
129
130
131
# File 'lib/sendgrid/helpers/mail/mail.rb', line 128

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

Instance Method Details

#enableObject


137
138
139
# File 'lib/sendgrid/helpers/mail/mail.rb', line 137

def enable
  @enable
end

#enable=(enable) ⇒ Object


133
134
135
# File 'lib/sendgrid/helpers/mail/mail.rb', line 133

def enable=(enable)
  @enable = enable
end

#substitution_tagObject


145
146
147
# File 'lib/sendgrid/helpers/mail/mail.rb', line 145

def substitution_tag
  @substitution_tag
end

#substitution_tag=(substitution_tag) ⇒ Object


141
142
143
# File 'lib/sendgrid/helpers/mail/mail.rb', line 141

def substitution_tag=(substitution_tag)
  @substitution_tag = substitution_tag
end

#to_jsonObject


149
150
151
152
153
154
# File 'lib/sendgrid/helpers/mail/mail.rb', line 149

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