Class: Kentaa::Api::Resources::NewsletterSubscription
- Inherits:
-
Resource
- Object
- Base
- Resource
- Kentaa::Api::Resources::NewsletterSubscription
show all
- Defined in:
- lib/kentaa/api/resources/newsletter_subscription.rb
Instance Attribute Summary
Attributes inherited from Resource
#id
Attributes inherited from Base
#config, #endpoint_path, #options, #resource_class
Instance Method Summary
collapse
Methods inherited from Resource
#create, #created_at, #delete, #initialize, #load, #save, #updated_at
Methods inherited from Base
attribute_key, #initialize, #load, #loaded?
Instance Method Details
#consent ⇒ Object
71
72
73
74
75
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 71
def consent
Kentaa::Api::Deprecation.warn('#consent is deprecated. Please use #consents instead.', caller)
@consent ||= Kentaa::Api::Resources::Consent.new(data[:consent]) if data[:consent]
end
|
#consents ⇒ Object
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 77
def consents
@consents ||= begin
consents = []
if data[:consents]
data[:consents].each do |consent|
consents << Kentaa::Api::Resources::Consent.new(consent)
end
end
consents
end
end
|
47
48
49
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 47
def donation_form_id
data[:donation_form_id]
end
|
#email ⇒ Object
59
60
61
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 59
def email
data[:email]
end
|
#first_name ⇒ Object
27
28
29
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 27
def first_name
data[:first_name]
end
|
#infix ⇒ Object
31
32
33
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 31
def infix
data[:infix]
end
|
#last_name ⇒ Object
35
36
37
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 35
def last_name
data[:last_name]
end
|
#locale ⇒ Object
63
64
65
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 63
def locale
data[:locale]
end
|
#name ⇒ Object
39
40
41
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 39
def name
[first_name, infix, last_name].reject { |s| s.to_s.empty? }.join(' ')
end
|
#object_key ⇒ Object
7
8
9
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 7
def object_key
"NewsletterSubscription_#{id}"
end
|
#project_id ⇒ Object
55
56
57
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 55
def project_id
data[:project_id]
end
|
#segment_id ⇒ Object
51
52
53
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 51
def segment_id
data[:segment_id]
end
|
#site ⇒ Object
23
24
25
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 23
def site
Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
end
|
#site_id ⇒ Object
43
44
45
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 43
def site_id
data[:site_id]
end
|
#subscription_url ⇒ Object
67
68
69
|
# File 'lib/kentaa/api/resources/newsletter_subscription.rb', line 67
def subscription_url
data[:subscription_url]
end
|