Sha256: ef2304954cc30a20922ea6980917aa8f7f88c0d0f93b3c57a64600b91da20e1c

Contents?: true

Size: 339 Bytes

Versions: 4

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

require 'base64'

module Yoti
  class Media
    attr_reader :content
    attr_reader :mime_type

    def initialize(content, mime_type)
      @content = content
      @mime_type = mime_type
    end

    def base64_content
      "data:#{mime_type};base64,#{Base64.strict_encode64(content)}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yoti-1.9.0 lib/yoti/data_type/media.rb
yoti-1.8.0 lib/yoti/data_type/media.rb
yoti-1.7.1 lib/yoti/data_type/media.rb
yoti-1.7.0 lib/yoti/data_type/media.rb