Sha256: cf75662d75f3bac1973f6839c95e35be4c5ad9a68db686bca6813eec48858dcc

Contents?: true

Size: 288 Bytes

Versions: 7

Compression:

Stored size: 288 Bytes

Contents

require "base64"

module Prez
  class DataUri
    attr_reader :type, :contents

    def initialize(type, contents)
      @type = type
      @contents = Base64.encode64 contents
      @contents.gsub! "\n", ""
    end

    def to_s
      "data:#{type};base64,#{contents}"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
prez-0.1.2 lib/prez/data_uri.rb
prez-0.1.1 lib/prez/data_uri.rb
prez-0.1.0 lib/prez/data_uri.rb
prez-0.0.6 lib/prez/data_uri.rb
prez-0.0.5 lib/prez/data_uri.rb
prez-0.0.4 lib/prez/data_uri.rb
prez-0.0.3 lib/prez/data_uri.rb