KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I understand that all classes in ruby are instances of metaclass Class. And that "regular" objects are instances of these classes (the instances of metaclass Class). But I keep wondering, I mean classes are root of objects, classes are themselves instances of Class (called metaclass because its instances are classes). I saw in some blogs some overriding of method new , of class Class. So Class behaves as a class, but its instances are classes. So it seems we have a circle, it looks likes class Class is an instance of itself. I'm clearly missing a point here. What is the origin of class Class? Here's an example that's confusing me: class Class def new #something end end But keyword class implies an instance of class Class. So how do this work?
Tags (comma-separated)
Save Edits
Cancel