Computing on rings by oblivious robots: a unified approach for different tasks