Class: SimpleGdrive::Cleaner
Overview
Cleans the directory Returns array of removed file names
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(base_folder_id:, move_to_trash: false) ⇒ Cleaner
constructor
A new instance of Cleaner.
Constructor Details
#initialize(base_folder_id:, move_to_trash: false) ⇒ Cleaner
Returns a new instance of Cleaner.
5 6 7 8 |
# File 'lib/simple_gdrive/cleaner.rb', line 5 def initialize(base_folder_id:, move_to_trash: false) @base_folder_id = base_folder_id @move_to_trash = move_to_trash end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/simple_gdrive/cleaner.rb', line 10 def call @page_token = nil @files_to_remove = {} loop do fetch_batch break if @page_token.nil? end remove_files @files_to_remove.values end |