Ruby-mongo-driver ping command does not return immediately when NoServerAvailable


I noticed during failover, the ping command doesn’t return immediately as indicated by the documentation:

Typically, it will take 60s before it finally fails with NoServerAvailable: No primary server is available in cluster.

I was looking at the source code to determine if there was a way to set a timeout:
db.command(:ping => 1)

However I didn’t find anything. Any suggestions or guidance on how to force it to timeout sooner?