Class: SendGrid::TrackingSettings

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTrackingSettings

Returns a new instance of TrackingSettings.


7
8
9
10
11
12
# File 'lib/sendgrid/helpers/mail/tracking_settings.rb', line 7

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

Instance Attribute Details

#click_trackingObject


14
15
16
# File 'lib/sendgrid/helpers/mail/tracking_settings.rb', line 14

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

#ganalyticsObject


26
27
28
# File 'lib/sendgrid/helpers/mail/tracking_settings.rb', line 26

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

#open_trackingObject


18
19
20
# File 'lib/sendgrid/helpers/mail/tracking_settings.rb', line 18

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

#subscription_trackingObject


22
23
24
# File 'lib/sendgrid/helpers/mail/tracking_settings.rb', line 22

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

Instance Method Details

#to_jsonObject


30
31
32
33
34
35
36
37
# File 'lib/sendgrid/helpers/mail/tracking_settings.rb', line 30

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