The Ruby dragon minigame happens during Laguna Dream 4 before the actual battle against a Ruby dragon. The goal is to hit the Ruby dragon 10 times before Laguna gets hit 3 times. It is quite a simple minigame, but it has a couple things that are important to increase the chances of survival and to go fast. The most important part is that whenever you are trying to block an attack, you should hold the block button instead of pressing it repeatedly. When the minigame starts, it gives you instructions on how to block and attack. The first attack should not be done when prompted to do so, because it will delay the first real hit against Ruby dragon. The first real attack can be done the moment the health bar appears.
Often, if Ruby dragon is attacked as it is starting its own attack animation, it will counter with an invisible fast attack that cannot be blocked. For this reason, if you are at risk of dying, if you can, you should block the attack instead of mindlessly attacking.
If Laguna gets hit 3 times, you will get the option to retry or to give up. Retrying will start the minigame again with both Laguna and Ruby dragon at full health. If you choose to give up, you will game over.
The Ruby dragon minigame is controlled by the same RNG that controls the Caraway mansion code, the Air soldier and the final party for Ultimecia. For this reason it is possible to always encounter the same pattern when fighting the Ruby dragon if you play extremely consistently this far into the game.