bumped version
[catagits/CatalystX-Declare.git] / lib / CatalystX / Declare / Keyword / Component.pm
1 use MooseX::Declare;
2
3 class CatalystX::Declare::Keyword::Component
4     extends MooseX::Declare::Syntax::Keyword::Class
5     with    CatalystX::Declare::DefaultSuperclassing {
6
7
8     before add_namespace_customizations (Object $ctx, Str $package) {
9
10         $ctx->add_preamble_code_parts(
11             'use CLASS',
12         );
13     }
14
15     method default_superclasses { 'Catalyst::Component' }
16 }
17
18 __END__
19
20 =head1 NAME
21
22 CatalystX::Declare::Keyword::Component - Declare Catalyst Components
23
24 =head1 DESCRIPTION
25
26 This handler provides common functionality for all component handlers.
27 Please refer to the respective keyword handler documentation for more
28 information:
29
30 =over
31
32 =item L<CatalystX::Declare::Keyword::Model>
33
34 =item L<CatalystX::Declare::Keyword::View>
35
36 =item L<CatalystX::Declare::Keyword::Controller>
37
38 =back
39
40 =head1 SUPERCLASSES
41
42 =over
43
44 =item L<MooseX::Declare::Syntax::Keyword::Class>
45
46 =back
47
48 =head1 ROLES
49
50 =head1 METHODS
51
52 These methods are implementation details. Unless you are extending or 
53 developing L<CatalystX::Declare>, you should not be concerned with them.
54
55 =head2 add_namespace_customizations
56
57     Object->add_namespace_customizations (Object $ctx, Str $package)
58
59 This will simply add L<CLASS> to the imported modules, to make C<CLASS>
60 and C<$CLASS> available in the component.
61
62 =head2 default_superclasses
63
64     List[Str] Object->default_superclasses ()
65
66 Returns L<Catalyst::Component> as default superclass for components. The
67 subclasses for other component keywords will usually want to override this.
68
69 =head1 SEE ALSO
70
71 =over
72
73 =item L<CatalystX::Declare>
74
75 =item L<CatalystX::Declare::Keyword::Model>
76
77 =item L<CatalystX::Declare::Keyword::View>
78
79 =item L<CatalystX::Declare::Keyword::Controller>
80
81 =item L<MooseX::Declare/class>
82
83 =back
84
85 =head1 AUTHOR
86
87 See L<CatalystX::Declare/AUTHOR> for author information.
88
89 =head1 LICENSE
90
91 This program is free software; you can redistribute it and/or modify it under 
92 the same terms as perl itself.
93
94 =cut