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, #created_at, #diff, #updated_at
Attributes included from ModelMagic
#scoped_organization, #scoped_space
Instance Method Summary
collapse
Methods inherited from Model
#attribute_for_error, #changed?, #create, #create!, #delete, #eql?, #exists?, #hash, inherited, #initialize, #inspect, #invalidate!, #manifest, #object_name, objects, #partial?, #persisted?, #plural_object_name, #query_target, #to_key, #to_param, #update!
Methods included from ModelMagic
#attributes, #defaults, #inherited, #object_name, params_from, #plural_object_name, #scoped_to_organization, #scoped_to_space, #to_many_relations, #to_one_relations
#queryable_by
#to_many
#to_one
#attribute
#has_summary
#add_client_methods
Instance Attribute Details
#emails ⇒ Object
optional metadata from UAA
40
41
42
|
# File 'lib/cfoundry/v2/user.rb', line 40
def emails
@emails
end
|
#name ⇒ Object
optional metadata from UAA
40
41
42
|
# File 'lib/cfoundry/v2/user.rb', line 40
def name
@name
end
|
Instance Method Details
#change_password!(new, old) ⇒ Object
35
36
37
|
# File 'lib/cfoundry/v2/user.rb', line 35
def change_password!(new, old)
@client.base.uaa.change_password(@guid, new, old)
end
|
#delete!(options = {}) ⇒ Object
65
66
67
68
|
# File 'lib/cfoundry/v2/user.rb', line 65
def delete! (options = {})
options[:user_delete] = guid
super (options)
end
|
#email ⇒ Object
42
43
44
45
|
# File 'lib/cfoundry/v2/user.rb', line 42
def email
return unless @emails && @emails.first
@emails.first[:value]
end
|
#family_name ⇒ Object
52
53
54
55
|
# File 'lib/cfoundry/v2/user.rb', line 52
def family_name
return unless @name && @name[:familyName] != email
@name[:familyName]
end
|
#full_name ⇒ Object
57
58
59
60
61
62
63
|
# File 'lib/cfoundry/v2/user.rb', line 57
def full_name
if @name && @name[:fullName]
@name[:fullName]
elsif given_name && family_name
"#{given_name} #{family_name}"
end
end
|
#given_name ⇒ Object
47
48
49
50
|
# File 'lib/cfoundry/v2/user.rb', line 47
def given_name
return unless @name && @name[:givenName] != email
@name[:givenName]
end
|
#guid ⇒ Object
22
23
24
|
# File 'lib/cfoundry/v2/user.rb', line 22
def guid
@guid
end
|
#guid=(x) ⇒ Object
28
29
30
31
|
# File 'lib/cfoundry/v2/user.rb', line 28
def guid=(x)
@guid = x
set_guid_attribute(x)
end
|
#set_guid_attribute ⇒ Object
26
|
# File 'lib/cfoundry/v2/user.rb', line 26
alias set_guid_attribute guid=
|