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
Instance Attribute Details
#emails ⇒ Object
optional metadata from UAA
39
40
41
|
# File 'lib/cfoundry/v2/user.rb', line 39
def emails
@emails
end
|
#name ⇒ Object
optional metadata from UAA
39
40
41
|
# File 'lib/cfoundry/v2/user.rb', line 39
def name
@name
end
|
Instance Method Details
#change_password!(new, old) ⇒ Object
34
35
36
|
# File 'lib/cfoundry/v2/user.rb', line 34
def change_password!(new, old)
@client.base.uaa.change_password(@guid, new, old)
end
|
#email ⇒ Object
41
42
43
44
|
# File 'lib/cfoundry/v2/user.rb', line 41
def email
return unless @emails && @emails.first
@emails.first[:value]
end
|
#family_name ⇒ Object
51
52
53
54
|
# File 'lib/cfoundry/v2/user.rb', line 51
def family_name
return unless @name && @name[:familyName] != email
@name[:familyName]
end
|
#full_name ⇒ Object
56
57
58
59
60
61
62
|
# File 'lib/cfoundry/v2/user.rb', line 56
def full_name
if @name && @name[:fullName]
@name[:fullName]
elsif given_name && family_name
"#{given_name} #{family_name}"
end
end
|
#given_name ⇒ Object
46
47
48
49
|
# File 'lib/cfoundry/v2/user.rb', line 46
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
27
28
29
30
|
# File 'lib/cfoundry/v2/user.rb', line 27
def guid=(x)
@guid = x
set_guid_attribute(x)
end
|
#set_guid_attribute ⇒ Object
25
|
# File 'lib/cfoundry/v2/user.rb', line 25
alias set_guid_attribute guid=
|