Module: Fargo::Supports::Uploads

Extended by:
ActiveSupport::Concern
Included in:
Client
Defined in:
lib/fargo/supports/uploads.rb

Instance Method Summary collapse

Instance Method Details

#open_upload_slotsObject



12
13
14
# File 'lib/fargo/supports/uploads.rb', line 12

def open_upload_slots
  [config.upload_slots - @taken_slots, 0].max
end

#release_slot!Object



20
21
22
# File 'lib/fargo/supports/uploads.rb', line 20

def release_slot!
  @taken_slots -= 1
end

#take_slot!Object



16
17
18
# File 'lib/fargo/supports/uploads.rb', line 16

def take_slot!
  @taken_slots += 1
end