Sha256: 5d7a55f6a38ecda1f64d10c4a2b674d47c0df57085917e45fcdb488f8f26cf2c

Contents?: true

Size: 440 Bytes

Versions: 6

Compression:

Stored size: 440 Bytes

Contents

module Attachs
  module Storages
    class Base

      private

      def detect_content_type(path)
        MIME::Types.type_for(path).first.to_s
      end

      def processable?(path)
        detect_content_type(path) =~ /^image\//
      end

      def build_processor(path)
        case detect_content_type(path)
        when /^image\//
          klass = Processors::Image
        end
        klass.new path
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
attachs-4.0.0.5 lib/attachs/storages/base.rb
attachs-4.0.0.4 lib/attachs/storages/base.rb
attachs-4.0.0.3 lib/attachs/storages/base.rb
attachs-4.0.0.2 lib/attachs/storages/base.rb
attachs-4.0.0.1 lib/attachs/storages/base.rb
attachs-4.0.0.0 lib/attachs/storages/base.rb