Class: Ungulate::BlobProcessor
- Inherits:
-
Object
- Object
- Ungulate::BlobProcessor
- Defined in:
- lib/ungulate/blob_processor.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ BlobProcessor
constructor
A new instance of BlobProcessor.
- #process(options) ⇒ Object
Constructor Details
#initialize(options) ⇒ BlobProcessor
Returns a new instance of BlobProcessor.
3 4 5 |
# File 'lib/ungulate/blob_processor.rb', line 3 def initialize() @creator = [:version_creator] end |
Instance Method Details
#process(options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ungulate/blob_processor.rb', line 7 def process() versions = .delete(:versions) blob = .delete(:blob) original_key = .delete(:original_key) bucket = .delete(:bucket) versions.each_pair do |name, instructions| stored_data = @creator.create(blob, instructions) bucket.store( new_key(original_key, name), stored_data[:blob], :version => name, :content_type => stored_data[:content_type] ) end end |