Every thing in mruby are object and refer to its singleton class. Non class object singleton class parent is the class of the object. Class object singleton class parent is mrb->class_class. Mruby internal define the const Class, Module, Object, BasicObject.
Almost every object has its owner singleton class, except
true, false, symbol, fixnum and float.
Objects have some basic types :
- False equal to nil
- Fix Number
- Include Class
- Sington Class
All class has its super class and BasicObject is the orignal class. The basic class superclass and singleton class chain :
BasicObject –> BasicOjbect singleton class ^ ^ | | Object –> Object singleton class ^ ^ | | Module –> Module singleton class ^ ^ | | Class –> Class singleton class ^ | SubClass –> Subclass singleton class ^ |<———————- | real object –> object singleton class
The basic class singleton class chain :
Class <— BasicObject