Class: Kentaa::Api::Resources::User
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
#address ⇒ Object
45
46
47
|
# File 'lib/kentaa/api/resources/user.rb', line 45
def address
data[:address]
end
|
#address2 ⇒ Object
49
50
51
|
# File 'lib/kentaa/api/resources/user.rb', line 49
def address2
data[:address2]
end
|
#avatar ⇒ Object
117
118
119
|
# File 'lib/kentaa/api/resources/user.rb', line 117
def avatar
@avatar ||= Kentaa::Api::Resources::Avatar.new(config, options: options.merge(endpoint_path: "/users/#{id}"))
end
|
#avatar_url ⇒ Object
41
42
43
|
# File 'lib/kentaa/api/resources/user.rb', line 41
def avatar_url
data[:avatar_url]
end
|
#birthday ⇒ Object
81
82
83
|
# File 'lib/kentaa/api/resources/user.rb', line 81
def birthday
Date.parse(data[:birthday]) if data[:birthday]
end
|
#city ⇒ Object
69
70
71
|
# File 'lib/kentaa/api/resources/user.rb', line 69
def city
data[:city]
end
|
#consents ⇒ Object
99
100
101
102
103
104
105
106
107
108
109
110
111
|
# File 'lib/kentaa/api/resources/user.rb', line 99
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
|
#country ⇒ Object
73
74
75
|
# File 'lib/kentaa/api/resources/user.rb', line 73
def country
data[:country]
end
|
#email ⇒ Object
37
38
39
|
# File 'lib/kentaa/api/resources/user.rb', line 37
def email
data[:email]
end
|
#first_name ⇒ Object
21
22
23
|
# File 'lib/kentaa/api/resources/user.rb', line 21
def first_name
data[:first_name]
end
|
#gender ⇒ Object
85
86
87
|
# File 'lib/kentaa/api/resources/user.rb', line 85
def gender
data[:gender]
end
|
#house_number ⇒ Object
57
58
59
|
# File 'lib/kentaa/api/resources/user.rb', line 57
def house_number
data[:house_number]
end
|
#house_number_addition ⇒ Object
61
62
63
|
# File 'lib/kentaa/api/resources/user.rb', line 61
def house_number_addition
data[:house_number_addition]
end
|
#infix ⇒ Object
25
26
27
|
# File 'lib/kentaa/api/resources/user.rb', line 25
def infix
data[:infix]
end
|
#last_name ⇒ Object
29
30
31
|
# File 'lib/kentaa/api/resources/user.rb', line 29
def last_name
data[:last_name]
end
|
#locale ⇒ Object
89
90
91
|
# File 'lib/kentaa/api/resources/user.rb', line 89
def locale
data[:locale]
end
|
#name ⇒ Object
33
34
35
|
# File 'lib/kentaa/api/resources/user.rb', line 33
def name
[first_name, infix, last_name].reject { |s| s.to_s.empty? }.join(' ')
end
|
#object_key ⇒ Object
9
10
11
|
# File 'lib/kentaa/api/resources/user.rb', line 9
def object_key
"User_#{id}"
end
|
#phone ⇒ Object
77
78
79
|
# File 'lib/kentaa/api/resources/user.rb', line 77
def phone
data[:phone]
end
|
#site ⇒ Object
13
14
15
|
# File 'lib/kentaa/api/resources/user.rb', line 13
def site
Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
end
|
#site_id ⇒ Object
17
18
19
|
# File 'lib/kentaa/api/resources/user.rb', line 17
def site_id
data[:site_id]
end
|
#street ⇒ Object
53
54
55
|
# File 'lib/kentaa/api/resources/user.rb', line 53
def street
data[:street]
end
|
#zipcode ⇒ Object
65
66
67
|
# File 'lib/kentaa/api/resources/user.rb', line 65
def zipcode
data[:zipcode]
end
|