Parent

Methods

Files

Class/Module Index [+]

Quicksearch

Paperclip::ContentTypeDetector

Public Class Methods

new(filename) click to toggle source
# File lib/paperclip/content_type_detector.rb, line 6
def initialize(filename)
  @filename = filename
end

Public Instance Methods

detect() click to toggle source
# File lib/paperclip/content_type_detector.rb, line 10
def detect
  if blank_name?
    SENSIBLE_DEFAULT
  elsif empty_file?
    EMPTY_TYPE
  elsif !match?
    type_from_file_command
  elsif !multiple?
    possible_types.first
  else
    best_type_match
  end.to_s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.