+++ /dev/null
----
-name: Class-C3-Componentised
-version: 0.01
-author:
- - 'Matt S. Trout <mst@shadowcatsystems.co.uk>'
-abstract: ~
-license: perl
-requires:
- Class::C3: 0
-build_requires:
- Test::More: 0
-provides:
- Class::C3::Componentised:
- file: lib/Class/C3/Componentised.pm
- version: 0.01
-generated_by: Module::Build version 0.26
use base 'Class::C3::Componentised';
- sub component_base_class { "MyModule::Plugin" }
+ sub component_base_class { "MyModule::Component" }
package main;
- MyModule->load_components( $self->{plugins} );
+ MyModule->load_components( qw/Foo Bar/ );
+ # Will load MyModule::Component::Foo an MyModule::Component::Bar
+
+=head1 DESCRIPTION
+
+This will inject base classes to your module using the L<Class::C3> method
+resolution order.
+
+Please note: these are not plugins that can take precedence over methods
+declared in MyModule. If you want something like that, consider
+L<MooseX::Object::Pluggable>.
=head1 METHODS
{
no strict 'refs';
foreach my $to (reverse @to_inject) {
- unshift( @{"${target}::ISA"}, $to )
+ unshift ( @{"${target}::ISA"}, $to )
unless ($target eq $to || $target->isa($to));
}
}
sub component_base_class { "MyModule::Plugin" }
-sub message { "MyModule" }
+sub message {
+ my $msg = $_[0]->maybe::next::method() || '';
+
+ return $msg . " MyModule";
+}
sub new {
return bless {}, shift;