Class: CFoundry::V2::User
- Inherits:
-
Model
- Object
- Model
- CFoundry::V2::User
show all
- Defined in:
- lib/cfoundry/v2/user.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Model
attribute, #create!, defaults, #delete!, #eql?, #exists?, #hash, #initialize, #inspect, #invalidate!, #manifest, #object_name, to_many, to_one, #update!, validate_type, value_matches?
Instance Attribute Details
#emails ⇒ Object
optional metadata from UAA
33
34
35
|
# File 'lib/cfoundry/v2/user.rb', line 33
def emails
@emails
end
|
#name ⇒ Object
optional metadata from UAA
33
34
35
|
# File 'lib/cfoundry/v2/user.rb', line 33
def name
@name
end
|
Instance Method Details
#change_password!(new, old) ⇒ Object
28
29
30
|
# File 'lib/cfoundry/v2/user.rb', line 28
def change_password!(new, old)
@client.base.uaa.change_password(@guid, new, old)
end
|
#email ⇒ Object
35
36
37
38
|
# File 'lib/cfoundry/v2/user.rb', line 35
def email
return unless @emails && @emails.first
@emails.first[:value]
end
|
#family_name ⇒ Object
45
46
47
48
|
# File 'lib/cfoundry/v2/user.rb', line 45
def family_name
return unless @name && @name[:familyName] != email
@name[:familyName]
end
|
#full_name ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/cfoundry/v2/user.rb', line 50
def full_name
if @name && @name[:fullName]
@name[:fullName]
elsif given_name && family_name
"#{given_name} #{family_name}"
end
end
|
#given_name ⇒ Object
40
41
42
43
|
# File 'lib/cfoundry/v2/user.rb', line 40
def given_name
return unless @name && @name[:givenName] != email
@name[:givenName]
end
|
#guid ⇒ Object
17
18
19
|
# File 'lib/cfoundry/v2/user.rb', line 17
def guid
@guid
end
|
#guid=(x) ⇒ Object
21
22
23
24
|
# File 'lib/cfoundry/v2/user.rb', line 21
def guid=(x)
@guid = x
super
end
|