Class: Workarea::Listrak::Models::Contact

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/listrak/models/contact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hashObject (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_addressString

Email address of the contact.

Returns:

  • (String)


14
15
16
# File 'app/services/workarea/listrak/models/contact.rb', line 14

def email_address
  hash['emailAddress']
end

#email_keyString

Listrak email key of the contact.

Returns:

  • (String)


22
23
24
# File 'app/services/workarea/listrak/models/contact.rb', line 22

def email_key
  hash['emailKey']
end

#subscribe_dateDateTime

Subscribe date of the contact.

Returns:

  • (DateTime)


38
39
40
# File 'app/services/workarea/listrak/models/contact.rb', line 38

def subscribe_date
  DateTime.strptime(hash["subscribeDate"], '%FT%T')
end

#subscribe_methodString

Subscribe method of the contact.

Returns:

  • (String)


46
47
48
# File 'app/services/workarea/listrak/models/contact.rb', line 46

def subscribe_method
  hash['subscribeMethod']
end

#subscription_stateString

Subscription state of the contact. Allowed values are Subscribed and Unsubscribed.

Returns:

  • (String)


30
31
32
# File 'app/services/workarea/listrak/models/contact.rb', line 30

def subscription_state
  hash['subscriptionState']
end

#unsubscribe_dateDateTime

Unsubscribe date of the contact.

Returns:

  • (DateTime)


54
55
56
# File 'app/services/workarea/listrak/models/contact.rb', line 54

def unsubscribe_date
  DateTime.strptime(hash["unsubscribeDate"], '%FT%T')
end

#unsubscribe_methodString

Unsubscribe method of the contact.

Returns:

  • (String)


62
63
64
# File 'app/services/workarea/listrak/models/contact.rb', line 62

def unsubscribe_method
  hash['unsubscribeMethod']
end