Class: Yoti::DocScan::Session::Create::RequestedCheck
- Inherits:
-
Object
- Object
- Yoti::DocScan::Session::Create::RequestedCheck
- Defined in:
- lib/yoti/doc_scan/session/create/requested_check.rb
Overview
Requests creation of a Check to be performed on a document
Direct Known Subclasses
RequestedDocumentAuthenticityCheck, RequestedFaceMatchCheck, RequestedLivenessCheck
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(type, config) ⇒ RequestedCheck
constructor
A new instance of RequestedCheck.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(type, config) ⇒ RequestedCheck
Returns a new instance of RequestedCheck.
15 16 17 18 19 20 21 22 23 |
# File 'lib/yoti/doc_scan/session/create/requested_check.rb', line 15 def initialize(type, config) raise(TypeError, "#{self.class} cannot be instantiated") if self.class == RequestedCheck Validation.assert_is_a(String, type, 'type') @type = type Validation.assert_respond_to(:as_json, config, 'config') @config = config end |
Instance Method Details
#as_json(*_args) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/yoti/doc_scan/session/create/requested_check.rb', line 29 def as_json(*_args) { type: @type, config: @config.as_json } end |
#to_json(*_args) ⇒ Object
25 26 27 |
# File 'lib/yoti/doc_scan/session/create/requested_check.rb', line 25 def to_json(*_args) as_json.to_json end |