mruby class
Basic Object
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 :
- True
- False equal to nil
- Free
- Fix Number
- Symbol
- Undef
- Float
- CPTR
- Object
- Class
- Module
- Include Class
- Sington Class
- Proc
- Arrasy
- Hash
- String
- Range
- Exception
- File
- Data
- Fiber
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