Class: SendGrid::OpenTracking

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OpenTracking.



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

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

Instance Attribute Details

#enableObject

Returns the value of attribute enable.



5
6
7
# File 'lib/sendgrid/helpers/mail/open_tracking.rb', line 5

def enable
  @enable
end

#substitution_tagObject

Returns the value of attribute substitution_tag.



5
6
7
# File 'lib/sendgrid/helpers/mail/open_tracking.rb', line 5

def substitution_tag
  @substitution_tag
end

Instance Method Details

#to_jsonObject



12
13
14
15
16
17
# File 'lib/sendgrid/helpers/mail/open_tracking.rb', line 12

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