I agree with Lord Sorril's post. One other reason that's sometimes a factor is if a snake is going into a shed cycle, which is why many snakes instinctively refuse to
eat at that time. Both digestion & shedding (ecdysis) uses up water in the snake's body to accomplish, & sometimes for some snakes, doing both simultaneously is
just a "bridge too far" and shedding takes precedence so they hurl their meal.

Check his eyes in dark room w/ small bright mini-flashlight for any clouding...it's easy to miss when the shed cycle is just beginning, & if that's the case, make sure
he's staying hydrated. Some snakes (not all) that "eat anyways" during shed will have a shed that gets stuck & only comes off in a zillion pieces. That's because
during the shed cycle the snake's body excretes some fluid between the old & new layers of skin to facilitate removing the outer layer...that's why hydration is so
important to a snake at that time. Typically snakes in shed also prefer to be cooler.

How long did he keep the rat down after eating it?