Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubysingleton eigenclassSingle-choice MCQ

What does `obj.singleton_class.ancestors.first(3)` return for the object below, and what does that say about where the singleton method lives in the lookup chain?

class C; end obj = C.new def obj.foo; :singleton; end obj.singleton_class.ancestors.first(3)