Class: SendGrid::Ganalytics

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

Instance Method Summary collapse

Constructor Details

#initialize(enable: nil, utm_source: nil, utm_medium: nil, utm_term: nil, utm_content: nil, utm_campaign: nil, utm_name: nil) ⇒ Ganalytics

Returns a new instance of Ganalytics.


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

def initialize(enable: nil, utm_source: nil, utm_medium: nil, utm_term: nil, utm_content: nil, utm_campaign: nil, utm_name: nil)
  @enable = enable
  @utm_source = utm_source
  @utm_medium = utm_medium
  @utm_term = utm_term
  @utm_content = utm_content
  @utm_campaign = utm_campaign
  @utm_name = utm_name
end

Instance Method Details

#enableObject


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

def enable
  @enable
end

#enable=(enable) ⇒ Object


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

def enable=(enable)
  @enable = enable
end

#to_jsonObject


65
66
67
68
69
70
71
72
73
74
# File 'lib/sendgrid/helpers/mail/mail.rb', line 65

def to_json(*)
  {
    'enable' => self.enable,
    'utm_source' => self.utm_source,
    'utm_medium' => self.utm_medium,
    'utm_term' => self.utm_term,
    'utm_content' => self.utm_content,
    'utm_campaign' => self.utm_campaign
  }.delete_if { |_, value| value.to_s.strip == '' }
end

#utm_campaignObject


61
62
63
# File 'lib/sendgrid/helpers/mail/mail.rb', line 61

def utm_campaign
  @utm_campaign
end

#utm_campaign=(utm_campaign) ⇒ Object


57
58
59
# File 'lib/sendgrid/helpers/mail/mail.rb', line 57

def utm_campaign=(utm_campaign)
  @utm_campaign = utm_campaign
end

#utm_contentObject


53
54
55
# File 'lib/sendgrid/helpers/mail/mail.rb', line 53

def utm_content
  @utm_content
end

#utm_content=(utm_content) ⇒ Object


49
50
51
# File 'lib/sendgrid/helpers/mail/mail.rb', line 49

def utm_content=(utm_content)
  @utm_content = utm_content
end

#utm_mediumObject


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

def utm_medium
  @utm_medium
end

#utm_medium=(utm_medium) ⇒ Object


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

def utm_medium=(utm_medium)
  @utm_medium = utm_medium
end

#utm_sourceObject


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

def utm_source
  @utm_source
end

#utm_source=(utm_source) ⇒ Object


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

def utm_source=(utm_source)
  @utm_source = utm_source
end

#utm_termObject


45
46
47
# File 'lib/sendgrid/helpers/mail/mail.rb', line 45

def utm_term
  @utm_term
end

#utm_term=(utm_term) ⇒ Object


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

def utm_term=(utm_term)
  @utm_term = utm_term
end