Class: Yoti::Attribute
- Inherits:
-
Object
- Object
- Yoti::Attribute
- Defined in:
- lib/yoti/data_type/attribute.rb
Overview
A class to represent a Yoti attribute.
A Yoti attribute consists of the attribute name, an associated attribute value, and a list of Anchors from Yoti.
It may hold one or more anchors, which specify how an attribute has been provided and how it has been verified within the Yoti platform.
Constant Summary collapse
- FAMILY_NAME =
'family_name'- GIVEN_NAMES =
'given_names'- FULL_NAME =
'full_name'- DATE_OF_BIRTH =
'date_of_birth'- GENDER =
'gender'- NATIONALITY =
'nationality'- PHONE_NUMBER =
'phone_number'- SELFIE =
'selfie'- EMAIL_ADDRESS =
'email_address'- POSTAL_ADDRESS =
'postal_address'- STRUCTURED_POSTAL_ADDRESS =
'structured_postal_address'- DOCUMENT_IMAGES =
'document_images'- DOCUMENT_DETAILS =
'document_details'- APPLICATION_NAME =
'application_name'- APPLICATION_LOGO =
'application_logo'- APPLICATION_URL =
'application_url'- APPLICATION_RECEIPT_BGCOLOR =
'application_receipt_bgcolor'- AGE_OVER =
'age_over:'- AGE_UNDER =
'age_under:'
Instance Attribute Summary collapse
-
#anchors ⇒ Array<Yoti::Anchor>
readonly
Get the anchors for an attribute.
-
#name ⇒ String
readonly
Gets the name of the attribute.
-
#sources ⇒ Array<Yoti::Anchor>
readonly
Sources are a subset of the anchors associated with an attribute, where the anchor type is SOURCE.
-
#value ⇒ String
readonly
Retrieves the value of an attribute.
-
#verifiers ⇒ Array<Yoti::Anchor>
readonly
Verifiers are a subset of the anchors associated with an attribute, where the anchor type is VERIFIER.
Instance Method Summary collapse
-
#initialize(name, value, sources, verifiers, anchors_list = {}) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(name, value, sources, verifiers, anchors_list = {}) ⇒ Attribute
Returns a new instance of Attribute.
79 80 81 82 83 84 85 |
# File 'lib/yoti/data_type/attribute.rb', line 79 def initialize(name, value, sources, verifiers, anchors_list = {}) @name = name @value = value @sources = sources @verifiers = verifiers @anchors = process_anchors_list(anchors_list) end |
Instance Attribute Details
#anchors ⇒ Array<Yoti::Anchor> (readonly)
Get the anchors for an attribute. If an attribute has only one SOURCE Anchor with the value set to “USER_PROVIDED” and zero VERIFIER Anchors, then the attribute is a self-certified one.
70 71 72 |
# File 'lib/yoti/data_type/attribute.rb', line 70 def anchors @anchors end |
#name ⇒ String (readonly)
Gets the name of the attribute.
37 38 39 |
# File 'lib/yoti/data_type/attribute.rb', line 37 def name @name end |
#sources ⇒ Array<Yoti::Anchor> (readonly)
Sources are a subset of the anchors associated with an attribute, where the anchor type is SOURCE.
53 54 55 |
# File 'lib/yoti/data_type/attribute.rb', line 53 def sources @sources end |
#value ⇒ String (readonly)
Retrieves the value of an attribute. If this is null, the default value for the type is returned.
45 46 47 |
# File 'lib/yoti/data_type/attribute.rb', line 45 def value @value end |
#verifiers ⇒ Array<Yoti::Anchor> (readonly)
Verifiers are a subset of the anchors associated with an attribute, where the anchor type is VERIFIER.
61 62 63 |
# File 'lib/yoti/data_type/attribute.rb', line 61 def verifiers @verifiers end |