What's the difference between a class and a module in Ruby

Asked 2 years ago, Updated 2 years ago, 135 views

I originally used Java, and I'm just learning Ruby.

It's a bit unfamiliar in Java, so I wonder exactly how modules and classes are different, and why they usually use modules, not classes.

class ruby

2022-09-22 21:59

1 Answers

Simply put, classes are created to create objects and modules are created to provide methods for classes.


2022-09-22 21:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.