| 1 |
NAME |
| 2 |
Class::C3::Componentised - Load mix-ins or components to your C3-based |
| 3 |
class |
| 4 |
|
| 5 |
SYNOPSIS |
| 6 |
package MyModule; |
| 7 |
|
| 8 |
use strict; |
| 9 |
use warnings; |
| 10 |
|
| 11 |
use base 'Class::C3::Componentised'; |
| 12 |
|
| 13 |
sub component_base_class { "MyModule::Component" } |
| 14 |
|
| 15 |
package main; |
| 16 |
|
| 17 |
MyModule->load_components( qw/Foo Bar/ ); |
| 18 |
# Will load MyModule::Component::Foo and MyModule::Component::Bar |
| 19 |
|
| 20 |
DESCRIPTION |
| 21 |
This will inject base classes to your module using the Class::C3 method |
| 22 |
resolution order. |
| 23 |
|
| 24 |
Please note: these are not plugins that can take precedence over methods |
| 25 |
declared in MyModule. If you want something like that, consider |
| 26 |
MooseX::Object::Pluggable. |
| 27 |
|
| 28 |
METHODS |
| 29 |
load_components( @comps ) |
| 30 |
Loads the given components into the current module. If a module begins |
| 31 |
with a "+" character, it is taken to be a fully qualified class name, |
| 32 |
otherwise "$class->component_base_class" is prepended to it. |
| 33 |
|
| 34 |
Calling this will call "Class::C3::reinitialize". |
| 35 |
|
| 36 |
load_own_components( @comps ) |
| 37 |
Similar to load_components, but assumes every class is "$class::$comp". |
| 38 |
|
| 39 |
load_optional_components |
| 40 |
As load_components, but will silently ignore any components that cannot |
| 41 |
be found. |
| 42 |
|
| 43 |
ensure_class_loaded |
| 44 |
Given a class name, tests to see if it is already loaded or otherwise |
| 45 |
defined. If it is not yet loaded, the package is require'd, and an |
| 46 |
exception is thrown if the class is still not loaded. |
| 47 |
|
| 48 |
BUG: For some reason, packages with syntax errors are added to %INC on |
| 49 |
require |
| 50 |
|
| 51 |
ensure_class_found |
| 52 |
Returns true if the specified class is installed or already loaded, |
| 53 |
false otherwise. |
| 54 |
|
| 55 |
inject_base |
| 56 |
Does the actual magic of adjusting @ISA on the target module. |
| 57 |
|
| 58 |
load_optional_class |
| 59 |
Returns a true value if the specified class is installed and loaded |
| 60 |
successfully, throws an exception if the class is found but not loaded |
| 61 |
successfully, and false if the class is not installed |
| 62 |
|
| 63 |
AUTHORS |
| 64 |
Matt S. Trout and the DBIx::Class team |
| 65 |
|
| 66 |
Pulled out into separate module by Ash Berlin "<[email protected]>" |
| 67 |
|
| 68 |
Optimizations and overall bolt-tightening by Peter "ribasushi" Rabbitson |
| 69 |
"<[email protected]>" |
| 70 |
|
| 71 |
COPYRIGHT |
| 72 |
Copyright (c) 2006 - 2011 the Class::C3::Componentised "AUTHORS" as |
| 73 |
listed above. |
| 74 |
|
| 75 |
LICENSE |
| 76 |
You may distribute this code under the same terms as Perl itself. |
| 77 |
|