Sha256: 802ea8bcbf696b323806b4f0f36a6d512d0e0ba66e0094060c009bd005e2f51a

Contents?: true

Size: 760 Bytes

Versions: 25

Compression:

Stored size: 760 Bytes

Contents

require 'attached/processor/base'
require 'attached/processor/audio'
require 'attached/processor/image'

module Attached
  module Processor
    
    
    # Create a storage object given a medium and credentials.
    #
    # Usage:
    #
    #   Attached::Processor.processor(:audio)
    #   Attached::Processor.processor(:image)
    #   Attached::Processor.processor(Attached::Processor::Custom.new)
    
    def self.processor(processor)
      
      return processor if processor.is_a? Attached::Processor::Base
      
      case processor
        when :audio then return Attached::Processor::Audio
        when :image then return Attached::Processor::Image
      end
      
      raise "undefined processor '#{processor}'"
      
    end
    
    
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
attached-0.5.2 lib/attached/processor.rb
attached-0.5.1 lib/attached/processor.rb
attached-0.5.0 lib/attached/processor.rb
attached-0.4.9 lib/attached/processor.rb
attached-0.4.8 lib/attached/processor.rb
attached-0.4.7 lib/attached/processor.rb
attached-0.4.6 lib/attached/processor.rb
attached-0.4.5 lib/attached/processor.rb
attached-0.4.4 lib/attached/processor.rb
attached-0.4.3 lib/attached/processor.rb
attached-0.4.2 lib/attached/processor.rb
attached-0.4.1 lib/attached/processor.rb
attached-0.4.0 lib/attached/processor.rb
attached-0.3.9 lib/attached/processor.rb
attached-0.3.8 lib/attached/processor.rb
attached-0.3.7 lib/attached/processor.rb
attached-0.3.6 lib/attached/processor.rb
attached-0.3.5 lib/attached/processor.rb
attached-0.3.4 lib/attached/processor.rb
attached-0.3.3 lib/attached/processor.rb