MooseX::Alien - Extend a non-Moose class with Moose
package MyApp::Context; use Moose; extends 'Mojolicious::Context'; with 'MooseX::Alien;
The fact that Moose objects are hashrefs means it is easy to use Moose to extend non-Moose classes, as long as they too are hash references.
This role usses an approach similar to the defined in Moose::Cookbook::FAQ. However this role will call BUILDARGS and BUILDALL
This approach may not work for all classes. The alien class must be implemented using a HASHREF and the constructor must accept either a list of name/value pairs or a HASHREF
Moose::Cookbook::FAQ MooseX::NonMoose
Graham Barr <gbarr@cpan.org>
Copyright (C) 2009 Graham Barr
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install MooseX::Alien, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Alien
CPAN shell
perl -MCPAN -e shell install MooseX::Alien
For more information on module installation, please visit the detailed CPAN module installation guide.