Class: SendGrid::TrackingSettings
- Inherits:
-
Object
- Object
- SendGrid::TrackingSettings
- Defined in:
- lib/sendgrid/helpers/mail/tracking_settings.rb
Instance Attribute Summary collapse
- #click_tracking ⇒ Object
- #ganalytics ⇒ Object
- #open_tracking ⇒ Object
- #subscription_tracking ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ TrackingSettings
constructor
A new instance of TrackingSettings.
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ TrackingSettings
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_tracking ⇒ Object
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 |
#ganalytics ⇒ Object
26 27 28 |
# File 'lib/sendgrid/helpers/mail/tracking_settings.rb', line 26 def ganalytics @ganalytics.nil? ? nil : @ganalytics.to_json end |
#open_tracking ⇒ Object
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_tracking ⇒ Object
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_json ⇒ Object
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 |