Sha256: 6b9f94254f1a635a9fdca24acb6824470a815d3e76376eef5b31260f75c0c56d

Contents?: true

Size: 799 Bytes

Versions: 4

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true

module Yoti
  module Sandbox
    module DocScan
      module Request
        class LivenessCheck < Check
          #
          # @param [CheckResult] result
          # @param [String] liveness_type
          #
          def initialize(result, liveness_type)
            raise(TypeError, "#{self.class} cannot be instantiated") if self.class == LivenessCheck

            super(result)

            Validation.assert_is_a(String, liveness_type, 'liveness_type')
            @liveness_type = liveness_type
          end

          def to_json(*_args)
            as_json.to_json
          end

          def as_json(*_args)
            super.merge(
              liveness_type: @liveness_type
            ).compact
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yoti_sandbox-1.3.0 lib/yoti_sandbox/doc_scan/request/check/liveness_check.rb
yoti_sandbox-1.2.1 lib/yoti_sandbox/doc_scan/request/check/liveness_check.rb
yoti_sandbox-1.2.0 lib/yoti_sandbox/doc_scan/request/check/liveness_check.rb
yoti_sandbox-1.1.0 lib/yoti_sandbox/doc_scan/request/check/liveness_check.rb