Class: Yoti::Profile

Inherits:
BaseProfile show all
Defined in:
lib/yoti/data_type/profile.rb

Overview

Encapsulates Yoti user profile

Instance Attribute Summary

Attributes inherited from BaseProfile

#attributes

Instance Method Summary collapse

Methods inherited from BaseProfile

#get_attribute, #initialize

Constructor Details

This class inherits a constructor from Yoti::BaseProfile

Instance Method Details

#age_verificationsArray

Finds all the ‘Age Over’ and ‘Age Under’ derived attributes returned with the profile, and returns them wrapped in AgeVerification objects

Returns:

  • (Array)


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_birthAttribute?

Date of birth.

Returns:



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_detailsAttribute?

Document Details.

Returns:



126
127
128
# File 'lib/yoti/data_type/profile.rb', line 126

def document_details
  get_attribute(Yoti::Attribute::DOCUMENT_DETAILS)
end

#document_imagesAttribute?

Document images.

Returns:



96
97
98
# File 'lib/yoti/data_type/profile.rb', line 96

def document_images
  get_attribute(Yoti::Attribute::DOCUMENT_IMAGES)
end

#email_addressAttribute?

The user’s verified email address.

Returns:



59
60
61
# File 'lib/yoti/data_type/profile.rb', line 59

def email_address
  get_attribute(Yoti::Attribute::EMAIL_ADDRESS)
end

#family_nameAttribute?

Corresponds to primary name in passport, and surname in English.

Returns:



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

Parameters:

  • age (Integer)

Returns:



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.

Parameters:

  • age (Integer)

Returns:



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_nameAttribute?

The user’s full name.

Returns:



40
41
42
# File 'lib/yoti/data_type/profile.rb', line 40

def full_name
  get_attribute(Yoti::Attribute::FULL_NAME)
end

#genderAttribute?

Corresponds to the gender in the passport; will be one of the strings “MALE”, “FEMALE”, “TRANSGENDER” or “OTHER”.

Returns:



78
79
80
# File 'lib/yoti/data_type/profile.rb', line 78

def gender
  get_attribute(Yoti::Attribute::GENDER)
end

#given_namesAttribute?

Corresponds to secondary names in passport, and first/middle names in English.

Returns:



31
32
33
# File 'lib/yoti/data_type/profile.rb', line 31

def given_names
  get_attribute(Yoti::Attribute::GIVEN_NAMES)
end

#nationalityAttribute?

Corresponds to the nationality in the passport.

Returns:



87
88
89
# File 'lib/yoti/data_type/profile.rb', line 87

def nationality
  get_attribute(Yoti::Attribute::NATIONALITY)
end

#phone_numberAttribute?

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”.

Returns:



50
51
52
# File 'lib/yoti/data_type/profile.rb', line 50

def phone_number
  get_attribute(Yoti::Attribute::PHONE_NUMBER)
end

#postal_addressAttribute?

The user’s postal address as a String.

Returns:



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

#selfieAttribute?

Selfie is a photograph of the user.

Returns:



13
14
15
# File 'lib/yoti/data_type/profile.rb', line 13

def selfie
  get_attribute(Yoti::Attribute::SELFIE)
end

#structured_postal_addressAttribute?

The user’s structured postal address as a JSON.

Returns:



117
118
119
# File 'lib/yoti/data_type/profile.rb', line 117

def structured_postal_address
  get_attribute(Yoti::Attribute::STRUCTURED_POSTAL_ADDRESS)
end