Sha256: 1c1ae1607a3308476c7721c4ef1dbca973745cecb5d5153a4f869056155dc130

Contents?: true

Size: 985 Bytes

Versions: 4

Compression:

Stored size: 985 Bytes

Contents

# frozen_string_literal: true

module Trusona
  module Resources
    ##
    # A record representing an identity document in the Trusona API
    class IdentityDocument < BaseResource
      include Trusona::Resources::Validators
      include Trusona::Helpers::KeyNormalizer

      attr_accessor :document_hash, :id, :type, :verification_status,
                    :user_identifier

      def initialize(params)
        normalized = normalize_keys(params)

        @params = normalized
        @document_hash = normalized[:document_hash]
        @id = normalized[:id]
        @type = normalized[:type]
        @verification_status = normalized[:verification_status]
        @user_identifier     = normalized[:user_identifier]
      end

      def to_json(*_args)
        JSON(
          hash: @document_hash,
          id: @id,
          type: @type,
          verification_status: @verification_status,
          user_identifier: @user_identifier
        )
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trusona-2.5.3 lib/trusona/resources/identity_document.rb
trusona-2.5.2 lib/trusona/resources/identity_document.rb
trusona-2.5.1 lib/trusona/resources/identity_document.rb
trusona-2.5.0 lib/trusona/resources/identity_document.rb