Module: Vines::Services::Controller::TransfersController::FileUploader

Includes:
Blather::FileTransfer::SimpleFileReceiver
Defined in:
lib/vines/services/controller/transfers_controller.rb

Instance Method Summary collapse

Instance Method Details

#initialize(path, size, storage) ⇒ Object



40
41
42
43
# File 'lib/vines/services/controller/transfers_controller.rb', line 40

def initialize(path, size, storage)
  super(path, size)
  @storage = storage
end

#unbindObject



45
46
47
48
49
50
51
52
53
# File 'lib/vines/services/controller/transfers_controller.rb', line 45

def unbind
  super
  return unless File.exist?(@path)
  Fiber.new do
    @storage.store_file(@path) do
      File.delete(@path) rescue nil
    end
  end.resume
end