Sha256: 074d555e591e91536b86511fd3563c54ab739d721f4d27ee5567681879564c5b

Contents?: true

Size: 259 Bytes

Versions: 23

Compression:

Stored size: 259 Bytes

Contents

module Lookbook
  class DataUriEncoder < Service
    attr_reader :str, :mime_type

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

    def call
      "data:#{mime_type},#{ERB::Util.url_encode(str)}"
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
lookbook-2.3.4 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.3.3 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.3.2 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.3.0 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.2.2 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.2.1 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.2.0 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.1.1 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.1.0 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.5 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.4 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.3 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.2 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.1 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.0 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.0.rc.3 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.0.rc.2 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.0.rc.1 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.0.beta.9 lib/lookbook/services/urls/data_uri_encoder.rb
lookbook-2.0.0.beta.8 lib/lookbook/services/urls/data_uri_encoder.rb