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
29
30
31
|
# File 'lib/cfoundry/v2/user.rb', line 29
def emails
@emails
end
|
#name ⇒ Object
optional metadata from UAA
29
30
31
|
# File 'lib/cfoundry/v2/user.rb', line 29
def name
@name
end
|
Instance Method Details
#email ⇒ Object
31
32
33
34
|
# File 'lib/cfoundry/v2/user.rb', line 31
def email
return unless @emails && @emails.first
@emails.first[:value]
end
|
#family_name ⇒ Object
41
42
43
44
|
# File 'lib/cfoundry/v2/user.rb', line 41
def family_name
return unless @name && @name[:familyName] != email
@name[:familyName]
end
|
#full_name ⇒ Object
46
47
48
49
50
51
52
|
# File 'lib/cfoundry/v2/user.rb', line 46
def full_name
if @name && @name[:fullName]
@name[:fullName]
elsif given_name && family_name
"#{given_name} #{family_name}"
end
end
|
#given_name ⇒ Object
36
37
38
39
|
# File 'lib/cfoundry/v2/user.rb', line 36
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
|