# File lib/gio2.rb, line 83 def each(cancellable = nil) return self.enum_for unless block_given? while file = next_file(cancellable) yield file end close self end
TODO: Return Enumerator unless block_given?
# File lib/gio2.rb, line 93 def each_async(num_files, io_priority = GLib::PRIORITY_DEFAULT, cancellable = nil, &block) each_async_loop num_files, io_priority, cancellable, block end
# File lib/gio2.rb, line 99 def each_async_loop(num_files, io_priority, cancellable, block) next_files_async num_files, io_priority, cancellable do |result| files = next_files_finish(result) files.each do |file| block.call file end if files.length > 0 each_async_loop num_files, io_priority, cancellable, block else close end end end