Class: Kentaa::Api::Resources::Consent
- Inherits:
-
Object
- Object
- Kentaa::Api::Resources::Consent
- Defined in:
- lib/kentaa/api/resources/consent.rb
Constant Summary collapse
- STATUS_GRANTED =
'granted'
- STATUS_REVOKED =
'revoked'
- TYPE_TERMS_CONDITIONS =
'terms_conditions'
- TYPE_PROCESSING_PERSONAL_DATA =
'processing_personal_data'
- TYPE_PROCESSING_PERSONAL_SENSITIVE_DATA =
'processing_personal_sensitive_data'
- TYPE_NEWSLETTER_SUBSCRIPTION =
'newsletter_subscription'
- TYPE_NEWS_ITEM_SUBSCRIPTION =
'news_item_subscription'
- TYPE_CONTACT_PHONE =
'contact_phone'
- TYPE_CONTACT_PHONE_COMMERCIAL =
'contact_phone_commercial'
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #consent_status ⇒ Object
- #consent_text ⇒ Object
- #consent_type ⇒ Object
- #contact_phone? ⇒ Boolean
- #contact_phone_commercial? ⇒ Boolean
- #granted? ⇒ Boolean
- #granted_at ⇒ Object
-
#initialize(data) ⇒ Consent
constructor
A new instance of Consent.
- #news_item_subscription? ⇒ Boolean
- #newsletter_subscription? ⇒ Boolean
- #privacy_version ⇒ Object
- #processing_personal_data? ⇒ Boolean
- #processing_personal_sensitive_data? ⇒ Boolean
- #revoked? ⇒ Boolean
- #revoked_at ⇒ Object
- #terms_conditions? ⇒ Boolean
- #terms_conditions_version ⇒ Object
- #text ⇒ Object
- #url ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(data) ⇒ Consent
Returns a new instance of Consent.
22 23 24 |
# File 'lib/kentaa/api/resources/consent.rb', line 22 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
20 21 22 |
# File 'lib/kentaa/api/resources/consent.rb', line 20 def data @data end |
Instance Method Details
#consent_status ⇒ Object
58 59 60 |
# File 'lib/kentaa/api/resources/consent.rb', line 58 def data[:consent_status] end |
#consent_text ⇒ Object
78 79 80 |
# File 'lib/kentaa/api/resources/consent.rb', line 78 def data[:consent_text] end |
#consent_type ⇒ Object
26 27 28 |
# File 'lib/kentaa/api/resources/consent.rb', line 26 def data[:consent_type] end |
#contact_phone? ⇒ Boolean
50 51 52 |
# File 'lib/kentaa/api/resources/consent.rb', line 50 def contact_phone? == TYPE_CONTACT_PHONE end |
#contact_phone_commercial? ⇒ Boolean
54 55 56 |
# File 'lib/kentaa/api/resources/consent.rb', line 54 def contact_phone_commercial? == TYPE_CONTACT_PHONE_COMMERCIAL end |
#granted? ⇒ Boolean
62 63 64 |
# File 'lib/kentaa/api/resources/consent.rb', line 62 def granted? == STATUS_GRANTED end |
#granted_at ⇒ Object
70 71 72 |
# File 'lib/kentaa/api/resources/consent.rb', line 70 def granted_at Time.parse(data[:granted_at]) end |
#news_item_subscription? ⇒ Boolean
46 47 48 |
# File 'lib/kentaa/api/resources/consent.rb', line 46 def news_item_subscription? == TYPE_NEWS_ITEM_SUBSCRIPTION end |
#newsletter_subscription? ⇒ Boolean
42 43 44 |
# File 'lib/kentaa/api/resources/consent.rb', line 42 def == TYPE_NEWSLETTER_SUBSCRIPTION end |
#privacy_version ⇒ Object
98 99 100 |
# File 'lib/kentaa/api/resources/consent.rb', line 98 def privacy_version data[:privacy_version] end |
#processing_personal_data? ⇒ Boolean
34 35 36 |
# File 'lib/kentaa/api/resources/consent.rb', line 34 def processing_personal_data? == TYPE_PROCESSING_PERSONAL_DATA end |
#processing_personal_sensitive_data? ⇒ Boolean
38 39 40 |
# File 'lib/kentaa/api/resources/consent.rb', line 38 def processing_personal_sensitive_data? == TYPE_PROCESSING_PERSONAL_SENSITIVE_DATA end |
#revoked? ⇒ Boolean
66 67 68 |
# File 'lib/kentaa/api/resources/consent.rb', line 66 def revoked? == STATUS_REVOKED end |
#revoked_at ⇒ Object
74 75 76 |
# File 'lib/kentaa/api/resources/consent.rb', line 74 def revoked_at Time.parse(data[:revoked_at]) if data[:revoked_at] end |
#terms_conditions? ⇒ Boolean
30 31 32 |
# File 'lib/kentaa/api/resources/consent.rb', line 30 def terms_conditions? == TYPE_TERMS_CONDITIONS end |
#terms_conditions_version ⇒ Object
94 95 96 |
# File 'lib/kentaa/api/resources/consent.rb', line 94 def terms_conditions_version data[:terms_conditions_version] end |
#text ⇒ Object
82 83 84 |
# File 'lib/kentaa/api/resources/consent.rb', line 82 def text data[:text] || data[:consent_text] end |
#url ⇒ Object
86 87 88 |
# File 'lib/kentaa/api/resources/consent.rb', line 86 def url data[:url] end |
#version ⇒ Object
90 91 92 |
# File 'lib/kentaa/api/resources/consent.rb', line 90 def version data[:version] || data[:terms_conditions_version] end |