class Net::SFTP::Operations::Dir

A convenience class for working with remote directories. It provides methods for searching and enumerating directory entries, similarly to the standard ::Dir class.

sftp.dir.foreach("/remote/path") do |entry|
  puts entry.name
end

p sftp.dir.entries("/remote/path").map { |e| e.name }

sftp.dir.glob("/remote/path", "**/*.rb") do |entry|
  puts entry.name
end