Sha256: a9e154992ca607f264cd72fc398722f2f05ae7e438963a6d5148d7e24acc110e

Contents?: true

Size: 926 Bytes

Versions: 8

Compression:

Stored size: 926 Bytes

Contents

# frozen_string_literal: true

require 'base64'

module Yoti
  module Share
    class Definition
      attr_reader :name

      #
      # Constructor
      #
      # @param [String] name
      #
      def initialize(name)
        @name = name
      end
    end

    class AttributeIssuanceDetails
      attr_reader :token
      attr_reader :attributes
      attr_reader :expiry_date

      #
      # Constructor
      #
      # @param [Yoti::Protobuf::Sharepubapi::ThirdPartyAttribute] data_entry
      #
      def initialize(data_entry)
        @token = Base64.strict_encode64(data_entry.issuance_token)
        begin
          @expiry_date = DateTime.parse(data_entry.issuing_attributes.expiry_date)
        rescue ArgumentError
          @expiry_date = nil
        end
        @attributes = data_entry.issuing_attributes.definitions.map do |defn|
          Definition.new(defn.name)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
yoti-1.9.0 lib/yoti/share/attribute_issuance_details.rb
yoti-1.8.0 lib/yoti/share/attribute_issuance_details.rb
yoti-1.7.1 lib/yoti/share/attribute_issuance_details.rb
yoti-1.7.0 lib/yoti/share/attribute_issuance_details.rb
yoti-1.6.4 lib/yoti/share/attribute_issuance_details.rb
yoti-1.6.3 lib/yoti/share/attribute_issuance_details.rb
yoti-1.6.2 lib/yoti/share/attribute_issuance_details.rb
yoti-1.6.1 lib/yoti/share/attribute_issuance_details.rb