Class: Yoti::DocumentDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/yoti/data_type/document_details.rb

Constant Summary collapse

VALIDATION_PATTERN =
Deprecated.

2.0.0 pattern is no longer used for validation.

'^([A-Za-z_]*) ([A-Za-z]{3}) ([A-Za-z0-9]{1}).*$'
TYPE_INDEX =
0
COUNTRY_INDEX =
1
NUMBER_INDEX =
2
EXPIRATION_INDEX =
3
AUTHORITY_INDEX =
4

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ DocumentDetails

Returns a new instance of DocumentDetails.

Parameters:

  • value (String)


53
54
55
# File 'lib/yoti/data_type/document_details.rb', line 53

def initialize(value)
  parse_value(value)
end

Instance Attribute Details

#document_numberString (readonly)

Document number (may include letters) from the document.

Returns:

  • (String)


33
34
35
# File 'lib/yoti/data_type/document_details.rb', line 33

def document_number
  @document_number
end

#expiration_dateDateTime (readonly)

Expiration date of the document in DateTime format. If the document does not expire, this field will not be present. The time part of this DateTime will default to 00:00:00.

Returns:

  • (DateTime)


41
42
43
# File 'lib/yoti/data_type/document_details.rb', line 41

def expiration_date
  @expiration_date
end

#issuing_authorityString (readonly)

Can either be a country code (for a state), or the name of the issuing authority.

Returns:

  • (String)


48
49
50
# File 'lib/yoti/data_type/document_details.rb', line 48

def issuing_authority
  @issuing_authority
end

#issuing_countryString (readonly)

ISO-3166-1 alpha-3 country code, e.g. “GBR”

Returns:

  • (String)


26
27
28
# File 'lib/yoti/data_type/document_details.rb', line 26

def issuing_country
  @issuing_country
end

#typeString (readonly)

Type of the document e.g. PASSPORT | DRIVING_LICENCE | NATIONAL_ID | PASS_CARD

Returns:

  • (String)


19
20
21
# File 'lib/yoti/data_type/document_details.rb', line 19

def type
  @type
end