Both the upload and download method can act recursively. This means that, given a directory name instead of a filename, will upload or download an entire directory tree. To get this behavior, pass a directory name to the upload or download methods and add the :recursive => true option to the method call. This example will download the logs directory and all its files, including all subdirectories and all their files, to the current directory on the local machine.
hostname = '192.168.1.113'
username = 'user'
password = 'pass'
Net::SSH.start( hostname, username, :password => password ) do|ssh|
ssh.scp.download!( 'logs', '.', :recursive => true )