Let me write down some difference between them as I know
- Modules can't be instantiated, whereas classes can be
- Multiple modules can be included / extended, whereas only one class can be inherited
Aside from the above mentioned two, I don't see any other differences between them
- Both can have class level variables (@@)
- Both can have class-instance level variables (@, initialized directly in the module/class)
- Both can have instance variables (@, initialized inside the methods)
- Both can have global variables ($)
- Both can have methods that can be directly called using their names (prefixed with "self")
- Both can have inner classes
- A class that includes and extends a module has access to all its methods (non-private) which is the same as inheriting from a class does for the subclass
Leaving the multiple inheritance out, is the only difference between classes and modules are that of creating objects?
(I don't have a lot of experience in Ruby, just trying to get my head around the difference between classes and modules. Please feel free to point out anything that I might have missed)