mercredi 8 avril 2020

Module and Class with the same name in Ruby

I haven't found a solution, and am confused as to whether a solution is even possible or if I need to change names entirely.

Say, for example I have module 'A' and module 'B'. In module B, there is a class called 'A', just like module 'A'. Inside this class, I want to reference A::ClassC, where 'A' is the module, but I am getting errors because it thinks I am referencing the class A, which does not have ClassC. Can I get around this? Or do I need to rename one? (I would like to avoid that as much as possible)

Aucun commentaire:

Enregistrer un commentaire