Class: Workarea::Listrak::Models::Contact
- Inherits:
-
Object
- Object
- Workarea::Listrak::Models::Contact
- Defined in:
- app/services/workarea/listrak/models/contact.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#email_address ⇒ String
Email address of the contact.
-
#email_key ⇒ String
Listrak email key of the contact.
-
#initialize(hash) ⇒ Contact
constructor
A new instance of Contact.
-
#subscribe_date ⇒ DateTime
Subscribe date of the contact.
-
#subscribe_method ⇒ String
Subscribe method of the contact.
-
#subscription_state ⇒ String
Subscription state of the contact.
-
#unsubscribe_date ⇒ DateTime
Unsubscribe date of the contact.
-
#unsubscribe_method ⇒ String
Unsubscribe method of the contact.
Constructor Details
#initialize(hash) ⇒ Contact
Returns a new instance of Contact.
6 7 8 |
# File 'app/services/workarea/listrak/models/contact.rb', line 6 def initialize(hash) @hash = hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
4 5 6 |
# File 'app/services/workarea/listrak/models/contact.rb', line 4 def hash @hash end |
Instance Method Details
#email_address ⇒ String
Email address of the contact.
14 15 16 |
# File 'app/services/workarea/listrak/models/contact.rb', line 14 def email_address hash['emailAddress'] end |
#email_key ⇒ String
Listrak email key of the contact.
22 23 24 |
# File 'app/services/workarea/listrak/models/contact.rb', line 22 def email_key hash['emailKey'] end |
#subscribe_date ⇒ DateTime
Subscribe date of the contact.
38 39 40 |
# File 'app/services/workarea/listrak/models/contact.rb', line 38 def subscribe_date DateTime.strptime(hash["subscribeDate"], '%FT%T') end |
#subscribe_method ⇒ String
Subscribe method of the contact.
46 47 48 |
# File 'app/services/workarea/listrak/models/contact.rb', line 46 def subscribe_method hash['subscribeMethod'] end |
#subscription_state ⇒ String
Subscription state of the contact. Allowed values are Subscribed and Unsubscribed.
30 31 32 |
# File 'app/services/workarea/listrak/models/contact.rb', line 30 def subscription_state hash['subscriptionState'] end |
#unsubscribe_date ⇒ DateTime
Unsubscribe date of the contact.
54 55 56 |
# File 'app/services/workarea/listrak/models/contact.rb', line 54 def unsubscribe_date DateTime.strptime(hash["unsubscribeDate"], '%FT%T') end |
#unsubscribe_method ⇒ String
Unsubscribe method of the contact.
62 63 64 |
# File 'app/services/workarea/listrak/models/contact.rb', line 62 def unsubscribe_method hash['unsubscribeMethod'] end |