SSH is not just for running commands, it's a general conduit for encrypted communications between two hosts. One common use for SSH is to transfer files using the SCP protocol over SSH. You can use SCP in your Ruby programs with the Net::SCP library, which is a supplement to Net::SSH. It's also a pure Ruby library, so it will work anywhere Net::SSH is available.
To install Net::SCP, install the net-scp gem. It has no dependencies beside Net::SSH and doesn't require any native extensions to be compiled.
$ gem install net-scp