class Attachs::Storages::Base

Private Instance Methods

build_processor(path) click to toggle source
# File lib/attachs/storages/base.rb, line 15
def build_processor(path)
  case detect_content_type(path)
  when /^image\//
    klass = Processors::Image
  end
  klass.new path
end
detect_content_type(path) click to toggle source
# File lib/attachs/storages/base.rb, line 7
def detect_content_type(path)
  MIME::Types.type_for(path).first.to_s
end
processable?(path) click to toggle source
# File lib/attachs/storages/base.rb, line 11
def processable?(path)
  detect_content_type(path) =~ /^image\//
end