+ 2

What is this used for?

10th Nov 2016, 4:18 PM
Peter Mauz
Peter Mauz - avatar
5 Answers
+ 6
modules make difference for the same name methods in same name classes. if one of these same name methods are under a module, Ruby will now know, which one of them you want to use.
1st Dec 2016, 3:41 PM
Boris Atanasov
Boris Atanasov - avatar
+ 2
not so much actually, go and read ruby's documentation and it will becomes more clear. nothing so big.
7th Jan 2017, 8:58 PM
Boris Atanasov
Boris Atanasov - avatar
+ 1
it is confusing
10th Nov 2016, 4:19 PM
Peter Mauz
Peter Mauz - avatar
+ 1
Modules are used for two things. One is namespacing, to avoid name clashing between methods and classes. The other is mixins (A way to achieve something similar to multiple inheritance. Think of java interfaces. Modules solve the same problem in a different way).
17th Jan 2017, 9:55 AM
Mariano Giagante
Mariano Giagante - avatar
0
thanks
24th Feb 2017, 4:06 PM
Peter Mauz
Peter Mauz - avatar