Class: SendGrid::SubscriptionTracking

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SubscriptionTracking.



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

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

Instance Attribute Details

#enableObject

Returns the value of attribute enable.



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

def enable
  @enable
end

#htmlObject

Returns the value of attribute html.



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

def html
  @html
end

#substitution_tagObject

Returns the value of attribute substitution_tag.



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

def substitution_tag
  @substitution_tag
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#to_jsonObject



14
15
16
17
18
19
20
21
# File 'lib/sendgrid/helpers/mail/subscription_tracking.rb', line 14

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