Sha256: 005c183282f3665c960674ca74b138409d78d59339a4d15b5542792fd1bc2e91

Contents?: true

Size: 716 Bytes

Versions: 13

Compression:

Stored size: 716 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

13 entries across 13 versions & 1 rubygems

Version Path
attached-1.0.4 lib/attached/processor.rb
attached-1.0.3 lib/attached/processor.rb
attached-1.0.2 lib/attached/processor.rb
attached-1.0.1 lib/attached/processor.rb
attached-1.0.0 lib/attached/processor.rb
attached-0.6.0 lib/attached/processor.rb
attached-0.5.9 lib/attached/processor.rb
attached-0.5.8 lib/attached/processor.rb
attached-0.5.7 lib/attached/processor.rb
attached-0.5.6 lib/attached/processor.rb
attached-0.5.5 lib/attached/processor.rb
attached-0.5.4 lib/attached/processor.rb
attached-0.5.3 lib/attached/processor.rb