I wrote a code (for the experiment:)):
class A
class << self
def self.f
puts "f"
end
def getMetaclass
class << self
self
end
end
end
end
A.getMetaclass.f
I understand that metaclass have their metaclass. Сorrect?
In the book “Metaprogramming Ruby” of Paolo Perrotta, the term metaclass is only mentioned once, instead the term “eigenclass” is used more often. The eigenclass of class A in your example is the metaclass, and it has its own metaclass (not metaclasses). So I have tried to expand your example, and it seems that this chain never ends:
The result here is:
I only cannot see what to do with such constructions 🙂