You should use as below :
Net::SSH.start('remotehost', 'ava') do |ssh|
puts ssh.host
end
As ssh
is an instance of Net::SSH::Connection::Session
class And if you browse the documentation
,you will get the method #host
,which will give you the desired result.