There are two ways to get singleton class of an object

object.singleton_class

—singleton_class = class << object self end