Class: SendGrid::SubscriptionTracking

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

Instance Method Summary collapse

Constructor Details

#initialize(enable: nil, text: nil, html: nil, substitution_tag: nil) ⇒ SubscriptionTracking

Returns a new instance of SubscriptionTracking.



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

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

Instance Method Details

#enableObject



16
17
18
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 16

def enable
  @enable
end

#enable=(enable) ⇒ Object



12
13
14
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 12

def enable=(enable)
  @enable = enable
end

#htmlObject



32
33
34
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 32

def html
  @html
end

#html=(html) ⇒ Object



28
29
30
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 28

def html=(html)
  @html = html
end

#substitution_tagObject



40
41
42
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 40

def substitution_tag
  @substitution_tag
end

#substitution_tag=(substitution_tag) ⇒ Object



36
37
38
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 36

def substitution_tag=(substitution_tag)
  @substitution_tag = substitution_tag
end

#textObject



24
25
26
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 24

def text
  @text
end

#text=(text) ⇒ Object



20
21
22
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 20

def text=(text)
  @text = text
end

#to_jsonObject



44
45
46
47
48
49
50
51
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 44

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