Hello and thanks for trusting me to help you and your pet today. I am a licensed veterinarian with over 25 years experience and would be happy work with you.
It is possible that it was from something he ate, but the food would have to be spoiled to cause that type of reaction. It is not uncommon for a cat to develop a acute gastroenteritis that presents with those types of signs and for us to never identify the cause. That is alright as long as it resolves or doesn't become a recurrent issue. When it does, we are often dealing with things like inflammatory bowel disease and there can be various reasons for that to occur and it needs to be worked up with more testing including bloodwork and some sort of imaging such as xray or ultrasound.
In Obi Wan's case, often the self imposed fast goes a long way to helping the gut get back to normal. Since he is an adult cat, a 12-24 hr fast will not hurt him and will let his gut calm down. Continue to offer small amounts of water at a time. When you do begin feeding him again, you will want to offer frequent, small meals of something very digestible for him. These would include items like boiled hamburger or chicken. No sauces or gravies, but a little non greasy broth would be OK. If the stools improve, I would continue that for a few days and then slowly wean him back onto his normal food and feeding schedule. If you can't entice him to eat or if the vomiting and/or diarrhea continue, he really needs to be evaluated by a veterinarian.
I hope this is helpful. Please let me know if you have ANY other questions. My goal is to give you 100% satisfaction and if you are not yet satisfied, please reply so I can clarify for you.
My posted replies are for general education only and not meant as a diagnosis. Only after a thorough veterinary examination can a diagnosis for your pet be made and specific treatments be advised or medications be prescribed.