Sha256: 2caa3ff97b51f5b8196e4d91685e8ba33c24da40732121b3a9729c29771cc864
Contents?: true
Size: 349 Bytes
Versions: 35
Compression:
Stored size: 349 Bytes
Contents
require "base64" class InlineImage def initialize(file_path) @filename = File.join(Renalware::Engine.root, file_path) @data = File.read(@filename) end def src "data:#{mime_type};base64,#{to_base64}" end def to_base64 Base64.encode64(@data) end def mime_type MIME::Types.type_for(@filename).first.to_s end end
Version data entries
35 entries across 35 versions & 1 rubygems