What is the equivalent of MooseX :: NonMoose for Moo?

I would like to use Moo instead of Moose, but I also need to inherit from non-Moose classes. How can I deal with this? Is there a module to get around this? If not, is there a way I can handle it myself?

+4
source share
1 answer

Moo can handle subclasses of non-Moo / Moose classes. You do not need an extension.

See the documentation for FOREIGNBUILDARGS , which states:

If you inherit from the non-Moo class, the arguments passed to the constructor of the parent class can be manipulated by defining the FOREIGNBUILDARGS method. It will receive the same arguments as BUILDARGS, and should return a list of arguments to jump to the constructor of the parent class.

+6
source

Source: https://habr.com/ru/post/1568118/


All Articles