Class: CFoundry::V2::User
Instance Attribute Summary collapse
-
#emails ⇒ Object
optional metadata from UAA.
-
#name ⇒ Object
optional metadata from UAA.
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Model
#==, attribute, #create!, defaults, #delete!, #exists?, #initialize, #inspect, #manifest, #object_name, to_many, to_one, #update!
Constructor Details
This class inherits a constructor from CFoundry::V2::Model
Instance Attribute Details
#emails ⇒ Object
optional metadata from UAA
25 26 27 |
# File 'lib/cfoundry/v2/user.rb', line 25 def emails @emails end |
#name ⇒ Object
optional metadata from UAA
25 26 27 |
# File 'lib/cfoundry/v2/user.rb', line 25 def name @name end |
Instance Method Details
#email ⇒ Object
27 28 29 30 |
# File 'lib/cfoundry/v2/user.rb', line 27 def email return unless @emails && @emails.first @emails.first[:value] end |
#family_name ⇒ Object
37 38 39 40 |
# File 'lib/cfoundry/v2/user.rb', line 37 def family_name return unless @name && @name[:familyName] != email @name[:familyName] end |
#full_name ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/cfoundry/v2/user.rb', line 42 def full_name if @name && @name[:fullName] @name[:fullName] elsif given_name && family_name "#{given_name} #{family_name}" end end |
#given_name ⇒ Object
32 33 34 35 |
# File 'lib/cfoundry/v2/user.rb', line 32 def given_name return unless @name && @name[:givenName] != email @name[:givenName] end |