Sha256: 7d9f412aa30f8690522c38eff4d0501320dca48539b59a68601c87133cdf0736

Contents?: true

Size: 908 Bytes

Versions: 5

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true

module Yoti
  module DocScan
    module Session
      module Retrieve
        class MediaResponse
          # @return [String]
          attr_reader :id

          # @return [String]
          attr_reader :type

          # @return [DateTime]
          attr_reader :created

          # @return [DateTime]
          attr_reader :last_updated

          #
          # @param [Hash] media
          #
          def initialize(media)
            Validation.assert_is_a(String, media['id'], 'id', true)
            @id = media['id']

            Validation.assert_is_a(String, media['type'], 'type', true)
            @type = media['type']

            @created = DateTime.parse(media['created']) unless media['created'].nil?

            @last_updated = DateTime.parse(media['last_updated']) unless media['last_updated'].nil?
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yoti-1.10.0 lib/yoti/doc_scan/session/retrieve/media_response.rb
yoti-1.9.0 lib/yoti/doc_scan/session/retrieve/media_response.rb
yoti-1.8.0 lib/yoti/doc_scan/session/retrieve/media_response.rb
yoti-1.7.1 lib/yoti/doc_scan/session/retrieve/media_response.rb
yoti-1.7.0 lib/yoti/doc_scan/session/retrieve/media_response.rb