Class: Yoti::Profile
- Inherits:
-
BaseProfile
- Object
- BaseProfile
- Yoti::Profile
- Defined in:
- lib/yoti/data_type/profile.rb
Overview
Encapsulates Yoti user profile
Instance Attribute Summary
Attributes inherited from BaseProfile
Instance Method Summary collapse
-
#age_verifications ⇒ Array
Finds all the ‘Age Over’ and ‘Age Under’ derived attributes returned with the profile, and returns them wrapped in AgeVerification objects.
-
#date_of_birth ⇒ Attribute?
Date of birth.
-
#document_details ⇒ Attribute?
Document Details.
-
#document_images ⇒ Attribute?
Document images.
-
#email_address ⇒ Attribute?
The user’s verified email address.
-
#family_name ⇒ Attribute?
Corresponds to primary name in passport, and surname in English.
-
#find_age_over_verification(age) ⇒ AgeVerification|nil
Searches for an AgeVerification corresponding to an ‘Age Over’ check for the given age.
-
#find_age_under_verification(age) ⇒ AgeVerification|nil
Searches for an AgeVerification corresponding to an ‘Age Under’ check for the given age.
-
#full_name ⇒ Attribute?
The user’s full name.
-
#gender ⇒ Attribute?
Corresponds to the gender in the passport; will be one of the strings “MALE”, “FEMALE”, “TRANSGENDER” or “OTHER”.
-
#given_names ⇒ Attribute?
Corresponds to secondary names in passport, and first/middle names in English.
-
#nationality ⇒ Attribute?
Corresponds to the nationality in the passport.
-
#phone_number ⇒ Attribute?
The user’s phone number, as verified at registration time.
-
#postal_address ⇒ Attribute?
The user’s postal address as a String.
-
#selfie ⇒ Attribute?
Selfie is a photograph of the user.
-
#structured_postal_address ⇒ Attribute?
The user’s structured postal address as a JSON.
Methods inherited from BaseProfile
Constructor Details
This class inherits a constructor from Yoti::BaseProfile
Instance Method Details
#age_verifications ⇒ Array
Finds all the ‘Age Over’ and ‘Age Under’ derived attributes returned with the profile, and returns them wrapped in AgeVerification objects
135 136 137 138 |
# File 'lib/yoti/data_type/profile.rb', line 135 def age_verifications find_all_age_verifications @age_verifications.values end |
#date_of_birth ⇒ Attribute?
Date of birth.
68 69 70 |
# File 'lib/yoti/data_type/profile.rb', line 68 def date_of_birth get_attribute(Yoti::Attribute::DATE_OF_BIRTH) end |
#document_details ⇒ Attribute?
Document Details.
126 127 128 |
# File 'lib/yoti/data_type/profile.rb', line 126 def document_details get_attribute(Yoti::Attribute::DOCUMENT_DETAILS) end |
#document_images ⇒ Attribute?
Document images.
96 97 98 |
# File 'lib/yoti/data_type/profile.rb', line 96 def document_images get_attribute(Yoti::Attribute::DOCUMENT_IMAGES) end |
#email_address ⇒ Attribute?
The user’s verified email address.
59 60 61 |
# File 'lib/yoti/data_type/profile.rb', line 59 def email_address get_attribute(Yoti::Attribute::EMAIL_ADDRESS) end |
#family_name ⇒ Attribute?
Corresponds to primary name in passport, and surname in English.
22 23 24 |
# File 'lib/yoti/data_type/profile.rb', line 22 def family_name get_attribute(Yoti::Attribute::FAMILY_NAME) end |
#find_age_over_verification(age) ⇒ AgeVerification|nil
Searches for an AgeVerification corresponding to an ‘Age Over’ check for the given age
147 148 149 |
# File 'lib/yoti/data_type/profile.rb', line 147 def find_age_over_verification(age) find_age_verification(Yoti::Attribute::AGE_OVER, age) end |
#find_age_under_verification(age) ⇒ AgeVerification|nil
Searches for an AgeVerification corresponding to an ‘Age Under’ check for the given age.
158 159 160 |
# File 'lib/yoti/data_type/profile.rb', line 158 def find_age_under_verification(age) find_age_verification(Yoti::Attribute::AGE_UNDER, age) end |
#full_name ⇒ Attribute?
The user’s full name.
40 41 42 |
# File 'lib/yoti/data_type/profile.rb', line 40 def full_name get_attribute(Yoti::Attribute::FULL_NAME) end |
#gender ⇒ Attribute?
Corresponds to the gender in the passport; will be one of the strings “MALE”, “FEMALE”, “TRANSGENDER” or “OTHER”.
78 79 80 |
# File 'lib/yoti/data_type/profile.rb', line 78 def gender get_attribute(Yoti::Attribute::GENDER) end |
#given_names ⇒ Attribute?
Corresponds to secondary names in passport, and first/middle names in English.
31 32 33 |
# File 'lib/yoti/data_type/profile.rb', line 31 def given_names get_attribute(Yoti::Attribute::GIVEN_NAMES) end |
#nationality ⇒ Attribute?
Corresponds to the nationality in the passport.
87 88 89 |
# File 'lib/yoti/data_type/profile.rb', line 87 def nationality get_attribute(Yoti::Attribute::NATIONALITY) end |
#phone_number ⇒ Attribute?
The user’s phone number, as verified at registration time. This will be a number with + for international prefix and no spaces, e.g. “+447777123456”.
50 51 52 |
# File 'lib/yoti/data_type/profile.rb', line 50 def phone_number get_attribute(Yoti::Attribute::PHONE_NUMBER) end |
#postal_address ⇒ Attribute?
The user’s postal address as a String.
105 106 107 108 109 110 |
# File 'lib/yoti/data_type/profile.rb', line 105 def postal_address postal_address = get_attribute(Yoti::Attribute::POSTAL_ADDRESS) return postal_address unless postal_address.nil? attribute_from_formatted_address end |
#selfie ⇒ Attribute?
Selfie is a photograph of the user.
13 14 15 |
# File 'lib/yoti/data_type/profile.rb', line 13 def selfie get_attribute(Yoti::Attribute::SELFIE) end |
#structured_postal_address ⇒ Attribute?
The user’s structured postal address as a JSON.
117 118 119 |
# File 'lib/yoti/data_type/profile.rb', line 117 def structured_postal_address get_attribute(Yoti::Attribute::STRUCTURED_POSTAL_ADDRESS) end |