Commit e89eecc
committed
No need to call rb_define_class/module_under_id
Classes/modules defined in a namespace are defined under ::Object
as usual (as without namespaces), and it'll be set into the const_tbl
of ::Object.
In namespaces, namespace objects' const_tbl is equal to the one of ::Object.
So constants of ::Object are just equal to constants of the namespace.
That means, top level classes/modules in a namespace can be referred
as namespace::KlassName without calling rb_define_class_under_id().1 parent bc77a11 commit e89eecc
2 files changed
+6
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1605 | 1605 | | |
1606 | 1606 | | |
1607 | 1607 | | |
1608 | | - | |
1609 | | - | |
| 1608 | + | |
1610 | 1609 | | |
1611 | | - | |
1612 | | - | |
1613 | | - | |
1614 | | - | |
1615 | 1610 | | |
1616 | 1611 | | |
1617 | 1612 | | |
| |||
1723 | 1718 | | |
1724 | 1719 | | |
1725 | 1720 | | |
1726 | | - | |
1727 | | - | |
| 1721 | + | |
1728 | 1722 | | |
1729 | | - | |
1730 | | - | |
1731 | | - | |
1732 | | - | |
1733 | 1723 | | |
1734 | 1724 | | |
1735 | 1725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| 718 | + | |
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
| |||
731 | 732 | | |
732 | 733 | | |
733 | 734 | | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
734 | 738 | | |
735 | 739 | | |
736 | 740 | | |
| |||
0 commit comments