Class: Kentaa::Api::Resources::User

Inherits:
Resource show all
Defined in:
lib/kentaa/api/resources/user.rb

Instance Attribute Summary

Attributes inherited from Resource

#id

Attributes inherited from Base

#config, #options

Instance Method Summary collapse

Methods inherited from Resource

#created_at, #delete, #initialize, #load, #save, #updated_at

Methods inherited from Base

#initialize, #load, #loaded?

Constructor Details

This class inherits a constructor from Kentaa::Api::Resources::Resource

Instance Method Details

#addressObject



41
42
43
# File 'lib/kentaa/api/resources/user.rb', line 41

def address
  data[:address]
end

#address2Object



45
46
47
# File 'lib/kentaa/api/resources/user.rb', line 45

def address2
  data[:address2]
end

#avatar_urlObject



37
38
39
# File 'lib/kentaa/api/resources/user.rb', line 37

def avatar_url
  data[:avatar_url]
end

#birthdayObject



77
78
79
# File 'lib/kentaa/api/resources/user.rb', line 77

def birthday
  Time.parse(data[:birthday]) if data[:birthday]
end

#cityObject



65
66
67
# File 'lib/kentaa/api/resources/user.rb', line 65

def city
  data[:city]
end


89
90
91
# File 'lib/kentaa/api/resources/user.rb', line 89

def consent
  @consent ||= Kentaa::Api::Resources::Consent.new(data[:consent]) if data[:consent]
end

#countryObject



69
70
71
# File 'lib/kentaa/api/resources/user.rb', line 69

def country
  data[:country]
end

#emailObject



33
34
35
# File 'lib/kentaa/api/resources/user.rb', line 33

def email
  data[:email]
end

#first_nameObject



17
18
19
# File 'lib/kentaa/api/resources/user.rb', line 17

def first_name
  data[:first_name]
end

#genderObject



81
82
83
# File 'lib/kentaa/api/resources/user.rb', line 81

def gender
  data[:gender]
end

#house_numberObject



53
54
55
# File 'lib/kentaa/api/resources/user.rb', line 53

def house_number
  data[:house_number]
end

#house_number_additionObject



57
58
59
# File 'lib/kentaa/api/resources/user.rb', line 57

def house_number_addition
  data[:house_number_addition]
end

#infixObject



21
22
23
# File 'lib/kentaa/api/resources/user.rb', line 21

def infix
  data[:infix]
end

#last_nameObject



25
26
27
# File 'lib/kentaa/api/resources/user.rb', line 25

def last_name
  data[:last_name]
end

#localeObject



85
86
87
# File 'lib/kentaa/api/resources/user.rb', line 85

def locale
  data[:locale]
end

#nameObject



29
30
31
# File 'lib/kentaa/api/resources/user.rb', line 29

def name
  [first_name, infix, last_name].reject { |s| s.to_s.empty? }.join(" ")
end

#object_keyObject



9
10
11
# File 'lib/kentaa/api/resources/user.rb', line 9

def object_key
  "User_#{id}"
end

#phoneObject



73
74
75
# File 'lib/kentaa/api/resources/user.rb', line 73

def phone
  data[:phone]
end

#site_idObject



13
14
15
# File 'lib/kentaa/api/resources/user.rb', line 13

def site_id
  data[:site_id]
end

#streetObject



49
50
51
# File 'lib/kentaa/api/resources/user.rb', line 49

def street
  data[:street]
end

#zipcodeObject



61
62
63
# File 'lib/kentaa/api/resources/user.rb', line 61

def zipcode
  data[:zipcode]
end