Sha256: b31a5fc44c1cc56c08e755b88ad7f15944e524b021bf814fd4f78a0bb27644af

Contents?: true

Size: 716 Bytes

Versions: 1

Compression:

Stored size: 716 Bytes

Contents

require "smart_id/api/authentication/base"
require "smart_id/exceptions"

module SmartId::Api
  module Authentication
    class IdentityNumber < Base
      BASE_URI = "authentication/pno"

      # @param country: 2 character ISO 3166-1 alpha-2 format(for example EE, LT, LV, KZ)
      # @param identity_number: national identity number of the individuals
      def initialize(**opts)
        @country = opts[:country].upcase
        @identity_number = opts[:identity_number]

        unless @country && @identity_number
          raise InvalidParamsError
        end

        super(**opts)
      end

      private

      def api_uri
        "#{BASE_URI}/#{@country}/#{@identity_number}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smart_id-0.1.0 lib/smart_id/api/authentication/identity_number.rb