Class: CFoundry::V2::User
- Inherits:
-
Model
- Object
- Model
- CFoundry::V2::User
show all
- Defined in:
- lib/cfoundry/v2/user.rb
Instance Attribute Summary collapse
Attributes inherited from Model
#cache, #changes
Attributes included from ModelMagic
#scoped_organization, #scoped_space
Instance Method Summary
collapse
Methods inherited from Model
#changed?, #create!, #delete!, #eql?, #exists?, #hash, #initialize, #inspect, #invalidate!, #manifest, #object_name, #partial?, #query_target, #update!
Methods included from ModelMagic
#attribute, #attributes, #defaults, #has_summary, #inherited, #object_name, params_from, #queryable_by, #scoped_to_organization, #scoped_to_space, #to_many, #to_many_relations, #to_one, #to_one_relations, validate_type, value_matches?
Instance Attribute Details
#emails ⇒ Object
optional metadata from UAA
37
38
39
|
# File 'lib/cfoundry/v2/user.rb', line 37
def emails
@emails
end
|
#name ⇒ Object
optional metadata from UAA
37
38
39
|
# File 'lib/cfoundry/v2/user.rb', line 37
def name
@name
end
|
Instance Method Details
#change_password!(new, old) ⇒ Object
32
33
34
|
# File 'lib/cfoundry/v2/user.rb', line 32
def change_password!(new, old)
@client.base.uaa.change_password(@guid, new, old)
end
|
#email ⇒ Object
39
40
41
42
|
# File 'lib/cfoundry/v2/user.rb', line 39
def email
return unless @emails && @emails.first
@emails.first[:value]
end
|
#family_name ⇒ Object
49
50
51
52
|
# File 'lib/cfoundry/v2/user.rb', line 49
def family_name
return unless @name && @name[:familyName] != email
@name[:familyName]
end
|
#full_name ⇒ Object
54
55
56
57
58
59
60
|
# File 'lib/cfoundry/v2/user.rb', line 54
def full_name
if @name && @name[:fullName]
@name[:fullName]
elsif given_name && family_name
"#{given_name} #{family_name}"
end
end
|
#given_name ⇒ Object
44
45
46
47
|
# File 'lib/cfoundry/v2/user.rb', line 44
def given_name
return unless @name && @name[:givenName] != email
@name[:givenName]
end
|
#guid ⇒ Object
21
22
23
|
# File 'lib/cfoundry/v2/user.rb', line 21
def guid
@guid
end
|
#guid=(x) ⇒ Object
25
26
27
28
|
# File 'lib/cfoundry/v2/user.rb', line 25
def guid=(x)
@guid = x
super
end
|