in reply to Dynamically adding methods to Moo class
That will depend on what the methods actually do. If they are simple getters/setters then yes, Moo has ways to automagically "generate" those as outlined (or at least hinted at) in the documentation.
For less standard methods you could use the normal approach of extracting the common code into a separate subroutine (or method) and have the individual (now slimmer) methods call that internally.
If you could provide an example of two of your almost identical methods we might be able to discern an appropriate path of action.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dynamically adding methods to Moo class
by McA (Priest) on Apr 23, 2014 at 16:14 UTC | |
by tobyink (Canon) on Apr 23, 2014 at 16:41 UTC | |
by McA (Priest) on Apr 23, 2014 at 16:54 UTC | |
by Arunbear (Prior) on Apr 24, 2014 at 12:51 UTC |