Class: PreventGo::Identity
- Inherits:
-
Base
- Object
- Base
- PreventGo::Identity
show all
- Defined in:
- lib/prevent_go/identity.rb
Instance Attribute Summary
Attributes inherited from Base
#params, #request
Instance Method Summary
collapse
Methods inherited from Base
#document_controls, #document_details, #document_type, #initialize
Instance Method Details
#fetch_holder_infos(*keys) ⇒ Object
17
18
19
20
|
# File 'lib/prevent_go/identity.rb', line 17
def fetch_holder_infos(*keys)
keys = default_holder_keys if keys.empty?
holder_data.slice(*keys).values.compact
end
|
#holder_controls ⇒ Object
9
10
11
|
# File 'lib/prevent_go/identity.rb', line 9
def holder_controls
@_holder_controls ||= @request.dig('controlsGroups', 'holder') || {}
end
|
#holder_data ⇒ Object
13
14
15
|
# File 'lib/prevent_go/identity.rb', line 13
def holder_data
@_holder_data || @request.dig('documentDetails', 'holder') || {}
end
|
#not_expired? ⇒ Boolean
31
32
33
|
# File 'lib/prevent_go/identity.rb', line 31
def not_expired?
@request.dig('controlsGroups', 'document', 'notExpired') == 'OK'
end
|
#quality_validated? ⇒ Boolean
22
23
24
25
26
27
28
29
|
# File 'lib/prevent_go/identity.rb', line 22
def quality_validated?
[
document_controls['typeRecognized'],
document_controls.dig('quality', 'aboveMinimumThreshold'),
document_controls['notExpired'],
document_controls['mrzValid']
].all? { |entry| entry == 'OK' }
end
|