class Shrine::Plugins::DetermineMimeType::MimeTypeAnalyzer
Constants
- MAGIC_NUMBER
- SUPPORTED_TOOLS
Public Class Methods
Source
# File lib/shrine/plugins/determine_mime_type.rb 79 def initialize(tool) 80 raise Error, "unknown mime type analyzer #{tool.inspect}, supported analyzers are: #{SUPPORTED_TOOLS.join(",")}" unless SUPPORTED_TOOLS.include?(tool) 81 82 @tool = tool 83 end
Public Instance Methods
Source
# File lib/shrine/plugins/determine_mime_type.rb 85 def call(io, options = {}) 86 mime_type = send(:"extract_with_#{@tool}", io, options) 87 io.rewind 88 89 mime_type 90 end