You can t get very far into ruby land without hearing that phrase.
Ruby object model diagram.
There are just a few things that exist in ruby that you need to understand to really grok its object model.
Thus variables don t have a predefined type which conflicts with uml s static typed object model.
So if you re a ruby programmer you probably know that everything in ruby is an object.
Hash array string integer and float.
When you write ruby code you are inside a main object that s why you can just write puts hello world instead of kernel puts hello world.
Everything is an object.
Differently from languages like java and c.
If you re a beginner you may want to look at a tutorial instead.
But another thing that s worth noting is ruby objects hierarchy.
Likewise a static uml object diagram is an instance of a class diagram.
Object includes the kernel module so object has all the instance methods of kernel like puts gets exit.
For ruby this post probably doesn t contain much new stuff for you.
Everything is an object or more precisely every box is this diagram is a basicobject.
The interesting thing is how those objects are linked together and classified.
We now have a mental model for how ruby manages classes instances superclasses and modules but why does it matter.
Umlify uses yuml probably the most used uml textual tool to render the diagram.
Using class ancestors included modules and superclass diagram the object model of these several commonly used ruby classes.
How does ruby internally represent and connect classes objects superclasses etc.
This is not an easy task since as the author comments.
Ruby s extreme decoupling and duck typing philosophy doesn t judge a class by its hierarchy.
You can open your irb console and see it for yourself by typing.
This video taken from my ruby reloaded course digs deep into what s going.
Since 11 january 2012 there is a diagram containing module inclusion links.
As part of my compiler project one of my imminent decisions is what object model to use and sine i like ruby it seemed a good time to go through ruby and look at the guts of the ruby object model if you ve dabbled in meta programming etc.
Since ruby 1 9 its hierarchy is like this.
It s true though everything in ruby is an object.