Sha256: f8cc066541e6ad5395fa070ce676818d4d8ee3485fc0b54331d4751d0948b42c
Contents?: true
Size: 687 Bytes
Versions: 15
Compression:
Stored size: 687 Bytes
Contents
module Scrivito # @api public # The FutureBinary class represents the data to be stored in a binary field. # See {Scrivito::Binary.upload} and {Scrivito::Binary#copy} for details. class FutureBinary attr_reader :filename, :content_type, :id_to_be_copied, :file_to_be_uploaded def initialize(filename:, content_type:, id_to_be_copied: nil, file_to_be_uploaded: nil) @filename = filename @content_type = content_type || content_type_of_filename(filename) @id_to_be_copied = id_to_be_copied @file_to_be_uploaded = file_to_be_uploaded end private def content_type_of_filename(filename) MIME::Types.type_for(filename).first.try(:content_type) end end end
Version data entries
15 entries across 15 versions & 1 rubygems