Class: SendGrid::TrackingSettings

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

Instance Method Summary collapse

Constructor Details

#initializeTrackingSettings

Returns a new instance of TrackingSettings.


188
189
190
191
192
193
# File 'lib/sendgrid/helpers/mail/mail.rb', line 188

def initialize
  @click_tracking = nil
  @open_tracking = nil
  @subscription_tracking = nil
  @ganalytics = nil
end

Instance Method Details

#click_trackingObject


199
200
201
# File 'lib/sendgrid/helpers/mail/mail.rb', line 199

def click_tracking
  @click_tracking.nil? ? nil : @click_tracking.to_json
end

#click_tracking=(click_tracking) ⇒ Object


195
196
197
# File 'lib/sendgrid/helpers/mail/mail.rb', line 195

def click_tracking=(click_tracking)
  @click_tracking = click_tracking
end

#ganalyticsObject


223
224
225
# File 'lib/sendgrid/helpers/mail/mail.rb', line 223

def ganalytics
  @ganalytics.nil? ? nil : @ganalytics.to_json
end

#ganalytics=(ganalytics) ⇒ Object


219
220
221
# File 'lib/sendgrid/helpers/mail/mail.rb', line 219

def ganalytics=(ganalytics)
  @ganalytics = ganalytics
end

#open_trackingObject


207
208
209
# File 'lib/sendgrid/helpers/mail/mail.rb', line 207

def open_tracking
  @open_tracking.nil? ? nil : @open_tracking.to_json
end

#open_tracking=(open_tracking) ⇒ Object


203
204
205
# File 'lib/sendgrid/helpers/mail/mail.rb', line 203

def open_tracking=(open_tracking)
  @open_tracking = open_tracking
end

#subscription_trackingObject


215
216
217
# File 'lib/sendgrid/helpers/mail/mail.rb', line 215

def subscription_tracking
  @subscription_tracking.nil? ? nil : @subscription_tracking.to_json
end

#subscription_tracking=(subscription_tracking) ⇒ Object


211
212
213
# File 'lib/sendgrid/helpers/mail/mail.rb', line 211

def subscription_tracking=(subscription_tracking)
  @subscription_tracking = subscription_tracking
end

#to_jsonObject


227
228
229
230
231
232
233
234
# File 'lib/sendgrid/helpers/mail/mail.rb', line 227

def to_json(*)
  {
    'click_tracking' => self.click_tracking,
    'open_tracking' => self.open_tracking,
    'subscription_tracking' => self.subscription_tracking,
    'ganalytics' => self.ganalytics
  }.delete_if { |_, value| value.to_s.strip == '' }
end