Class: RemoteFiles::ResqueJob
- Inherits:
-
Object
- Object
- RemoteFiles::ResqueJob
- Defined in:
- lib/remote_files/resque_job.rb
Class Method Summary collapse
Class Method Details
.perform(options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/remote_files/resque_job.rb', line 6 def self.perform() identifier = .delete(:identifier) || .delete("identifier") action = .delete(:_action) || .delete("_action") file = RemoteFiles::File.new(identifier, ) case action.to_sym when :synchronize file.synchronize! when :delete begin file.delete_now! rescue NotFoundError end else raise "unknown action #{action.inspect}" end end |