class S3Direct::ContentTypeDetection
Public Instance Methods
lookup()
click to toggle source
# File lib/s3direct/content_type_detection.rb, line 11 def lookup value = if filetype.to_s.empty? FilenameStrategy.new(filename).lookup else HybridStrategy.new(filename, filetype).lookup end remap(value) end
remap(value)
click to toggle source
# File lib/s3direct/content_type_detection.rb, line 21 def remap(value) mappings = { "application/mp4" => "video/mp4", "audio/mp3" => "audio/mpeg" } mappings.fetch(value, value) end