Module: Attached::Processor

Defined in:
lib/attached/processor.rb,
lib/attached/processor/base.rb,
lib/attached/processor/error.rb,
lib/attached/processor/audio.rb,
lib/attached/processor/image.rb

Defined Under Namespace

Classes: Audio, Base, Error, Image

Class Method Summary (collapse)

Class Method Details

+ (Object) processor(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)


17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/attached/processor.rb', line 17

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