Class: TrashMan::Manager
- Inherits:
-
Object
- Object
- TrashMan::Manager
- Defined in:
- lib/trashman/manager.rb
Instance Method Summary collapse
- #cleanup!(&block) ⇒ Object
-
#initialize(provider, options = {}) ⇒ Manager
constructor
A new instance of Manager.
Constructor Details
#initialize(provider, options = {}) ⇒ Manager
Returns a new instance of Manager.
6 7 8 9 10 11 12 |
# File 'lib/trashman/manager.rb', line 6 def initialize(provider, = {}) = @connection = Fog::Storage.new( { provider: provider }.merge([:credentials]) ) end |
Instance Method Details
#cleanup!(&block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/trashman/manager.rb', line 14 def cleanup!(&block) queued_files.each do |file| yield(file) if block if ![:dry_run] file.destroy end end queued_files.count end |