Sha256: 323ef8949220c66b196a65f107e5f2a10d2d152dbdde0a5fa12c4132519ca0df

Contents?: true

Size: 755 Bytes

Versions: 9

Compression:

Stored size: 755 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::Video)
    
    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

9 entries across 9 versions & 1 rubygems

Version Path
attached-0.2.7 lib/attached/processor.rb
attached-0.2.6 lib/attached/processor.rb
attached-0.2.5 lib/attached/processor.rb
attached-0.2.4 lib/attached/processor.rb
attached-0.2.3 lib/attached/processor.rb
attached-0.2.2 lib/attached/processor.rb
attached-0.2.1 lib/attached/processor.rb
attached-0.2.0 lib/attached/processor.rb
attached-0.1.9 lib/attached/processor.rb