Sha256: 5f8f139f900fe992c3b57d2b439ebcca4eeaf823574ae2a5683289d500c19adf
Contents?: true
Size: 466 Bytes
Versions: 24
Compression:
Stored size: 466 Bytes
Contents
module Mime class << self def method_missing m, *args raise "invalid usage of Mime!" unless args.empty? self[m] end def [] type type = ".#{type}" unless type =~ /^\./ Rack::Mime.mime_type(type) || raise("Unknown MIME type: #{type}") end def image? file_name return false if file_name.blank? extension = File.extname(file_name) Rack::Mime.mime_type(extension) =~ /image/ end end end
Version data entries
24 entries across 24 versions & 1 rubygems