Реклама

Ruby – modules

Modules in ruby are similar to classes, except: A module can have no instances. A module can have no subclasses. A module is defined by module … end Actually… the Module class of module is the superclass of the Class class of class. Got that? No? Let’s move on. There are two typical uses of modules.…