Class: PsuIdentity::SearchService::Person
- Inherits:
-
Object
- Object
- PsuIdentity::SearchService::Person
- Defined in:
- lib/psu_identity/search_service/person.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #affiliation ⇒ Object
- #conf_hold? ⇒ Boolean
- #cpr_id ⇒ Object
- #display_name ⇒ Object
- #family_name ⇒ Object (also: #surname)
- #given_name ⇒ Object
- #honorific_suffix ⇒ Object
-
#initialize(data = {}) ⇒ Person
constructor
A new instance of Person.
- #link ⇒ Object
- #middle_name ⇒ Object
- #other_email ⇒ Object
- #preferred_family_name ⇒ Object
- #preferred_given_name ⇒ Object
- #preferred_honorific_suffix ⇒ Object
- #preferred_middle_name ⇒ Object
- #psu_id ⇒ Object
- #university_email ⇒ Object
- #user_id ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Person
Returns a new instance of Person.
8 9 10 |
# File 'lib/psu_identity/search_service/person.rb', line 8 def initialize(data = {}) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/psu_identity/search_service/person.rb', line 5 def data @data end |
Instance Method Details
#active? ⇒ Boolean
57 58 59 |
# File 'lib/psu_identity/search_service/person.rb', line 57 def active? data['active'].is_a?(TrueClass) || data['active'] == 'true' end |
#affiliation ⇒ Object
73 74 75 |
# File 'lib/psu_identity/search_service/person.rb', line 73 def affiliation data.fetch('affiliation', []) end |
#conf_hold? ⇒ Boolean
61 62 63 |
# File 'lib/psu_identity/search_service/person.rb', line 61 def conf_hold? data['confHold'] == 'true' end |
#cpr_id ⇒ Object
20 21 22 |
# File 'lib/psu_identity/search_service/person.rb', line 20 def cpr_id data['cprid'] end |
#display_name ⇒ Object
77 78 79 |
# File 'lib/psu_identity/search_service/person.rb', line 77 def display_name data['displayName'] end |
#family_name ⇒ Object Also known as: surname
32 33 34 |
# File 'lib/psu_identity/search_service/person.rb', line 32 def family_name data['familyName'] end |
#given_name ⇒ Object
24 25 26 |
# File 'lib/psu_identity/search_service/person.rb', line 24 def given_name data['givenName'] end |
#honorific_suffix ⇒ Object
37 38 39 |
# File 'lib/psu_identity/search_service/person.rb', line 37 def honorific_suffix data['honorificSuffix'] end |
#link ⇒ Object
81 82 83 |
# File 'lib/psu_identity/search_service/person.rb', line 81 def link AtomicLink.new(data['link']) end |
#middle_name ⇒ Object
28 29 30 |
# File 'lib/psu_identity/search_service/person.rb', line 28 def middle_name data['middleName'] end |
#other_email ⇒ Object
69 70 71 |
# File 'lib/psu_identity/search_service/person.rb', line 69 def other_email data['otherEmail'] end |
#preferred_family_name ⇒ Object
49 50 51 |
# File 'lib/psu_identity/search_service/person.rb', line 49 def preferred_family_name data.fetch('preferredFamilyName', family_name) end |
#preferred_given_name ⇒ Object
41 42 43 |
# File 'lib/psu_identity/search_service/person.rb', line 41 def preferred_given_name data.fetch('preferredGivenName', given_name) end |
#preferred_honorific_suffix ⇒ Object
53 54 55 |
# File 'lib/psu_identity/search_service/person.rb', line 53 def preferred_honorific_suffix data.fetch('preferredHonorificSuffix', honorific_suffix) end |
#preferred_middle_name ⇒ Object
45 46 47 |
# File 'lib/psu_identity/search_service/person.rb', line 45 def preferred_middle_name data.fetch('preferredMiddleName', middle_name) end |
#psu_id ⇒ Object
12 13 14 |
# File 'lib/psu_identity/search_service/person.rb', line 12 def psu_id data['psuid'] end |
#university_email ⇒ Object
65 66 67 |
# File 'lib/psu_identity/search_service/person.rb', line 65 def university_email data['universityEmail'] end |
#user_id ⇒ Object
16 17 18 |
# File 'lib/psu_identity/search_service/person.rb', line 16 def user_id data['userid'] end |