File: README

package info (click to toggle)
libclass-c3-componentised-perl 1.001002-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 152 kB
  • sloc: perl: 250; makefile: 2
file content (77 lines) | stat: -rw-r--r-- 2,379 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
NAME
    Class::C3::Componentised - Load mix-ins or components to your C3-based
    class

SYNOPSIS
      package MyModule;

      use strict;
      use warnings;

      use base 'Class::C3::Componentised';

      sub component_base_class { "MyModule::Component" }

      package main;

      MyModule->load_components( qw/Foo Bar/ );
      # Will load MyModule::Component::Foo and MyModule::Component::Bar

DESCRIPTION
    This will inject base classes to your module using the 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
    MooseX::Object::Pluggable.

METHODS
  load_components( @comps )
    Loads the given components into the current module. If a module begins
    with a "+" character, it is taken to be a fully qualified class name,
    otherwise "$class->component_base_class" is prepended to it.

    Calling this will call "Class::C3::reinitialize".

  load_own_components( @comps )
    Similar to load_components, but assumes every class is "$class::$comp".

  load_optional_components
    As load_components, but will silently ignore any components that cannot
    be found.

  ensure_class_loaded
    Given a class name, tests to see if it is already loaded or otherwise
    defined. If it is not yet loaded, the package is require'd, and an
    exception is thrown if the class is still not loaded.

     BUG: For some reason, packages with syntax errors are added to %INC on
          require

  ensure_class_found
    Returns true if the specified class is installed or already loaded,
    false otherwise.

  inject_base
    Does the actual magic of adjusting @ISA on the target module.

  load_optional_class
    Returns a true value if the specified class is installed and loaded
    successfully, throws an exception if the class is found but not loaded
    successfully, and false if the class is not installed

AUTHORS
    Matt S. Trout and the DBIx::Class team

    Pulled out into separate module by Ash Berlin "<ash@cpan.org>"

    Optimizations and overall bolt-tightening by Peter "ribasushi" Rabbitson
    "<ribasushi@cpan.org>"

COPYRIGHT
    Copyright (c) 2006 - 2011 the Class::C3::Componentised "AUTHORS" as
    listed above.

LICENSE
    You may distribute this code under the same terms as Perl itself.