Class: Yoti::Sandbox::DocScan::Request::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/yoti_sandbox/doc_scan/request/check/check.rb

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Check

Returns a new instance of Check.

Parameters:

Raises:

  • (TypeError)


11
12
13
14
15
16
# File 'lib/yoti_sandbox/doc_scan/request/check/check.rb', line 11

def initialize(result)
  raise(TypeError, "#{self.class} cannot be instantiated") if instance_of?(Check)

  Validation.assert_is_a(CheckResult, result, 'result')
  @result = result
end

Instance Method Details

#as_json(*_args) ⇒ Object



22
23
24
25
26
# File 'lib/yoti_sandbox/doc_scan/request/check/check.rb', line 22

def as_json(*_args)
  {
    result: @result.as_json
  }
end

#to_json(*_args) ⇒ Object



18
19
20
# File 'lib/yoti_sandbox/doc_scan/request/check/check.rb', line 18

def to_json(*_args)
  as_json.to_json
end