Chapter 6. Method Lookup and Constant Lookup
Inside of Ruby, modules are classes.
As we saw in Chapter 5, classes play an important role in Ruby, holding method definitions and constant values, among other things. We also learned how Ruby implements inheritance using the super
pointer in each RClass
structure.
In fact, as your program grows, you might imagine it organized by class and superclass, creating a kind of giant tree structure. At the base is the Object
class (or, actually, the internal BasicObject
class). This class is Ruby’s default superclass, and all of your classes appear somewhere higher up in the tree, branching out in different directions. ...
Get Ruby Under a Microscope now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.