a71f65c4c4dbc16dc11514dfb55e367687290e7f
[gitmo/Moose.git] / lib / Moose / Meta / Role / Application.pm
1 package Moose::Meta::Role::Application;
2
3 use strict;
4 use warnings;
5 use metaclass;
6
7 our $VERSION   = '0.01';
8 our $AUTHORITY = 'cpan:STEVAN';
9
10 sub new { (shift)->meta->new_object(@_) }
11
12 sub apply {
13     my $self = shift;
14
15     $self->check_role_exclusions(@_);
16     $self->check_required_methods(@_);
17     $self->check_required_attributes(@_);
18     
19     $self->apply_attributes(@_);
20     $self->apply_methods(@_);    
21     
22     $self->apply_override_method_modifiers(@_);
23     
24     $self->apply_before_method_modifiers(@_);
25     $self->apply_around_method_modifiers(@_);
26     $self->apply_after_method_modifiers(@_);
27 }
28
29 sub check_role_exclusions           { die "Abstract Method" }
30 sub check_required_methods          { die "Abstract Method" }
31 sub check_required_attributes       { die "Abstract Method" }
32
33 sub apply_attributes                { die "Abstract Method" }
34 sub apply_methods                   { die "Abstract Method" }
35 sub apply_override_method_modifiers { die "Abstract Method" }
36 sub apply_method_modifiers          { die "Abstract Method" }
37
38 sub apply_before_method_modifiers   { (shift)->apply_method_modifiers('before' => @_) }
39 sub apply_around_method_modifiers   { (shift)->apply_method_modifiers('around' => @_) }
40 sub apply_after_method_modifiers    { (shift)->apply_method_modifiers('after'  => @_) }
41
42 1;
43
44 __END__
45
46 =pod
47
48 =head1 NAME
49
50 Moose::Meta::Role::Application
51
52 =head1 DESCRIPTION
53
54 This is the abstract base class for role applications.
55
56 =head2 METHODS
57
58 =over 4
59
60 =item B<new>
61
62 =item B<meta>
63
64 =item B<apply>
65
66 =item B<check_role_exclusions>
67
68 =item B<check_required_methods>
69
70 =item B<check_required_attributes>
71
72 =item B<apply_attributes>
73
74 =item B<apply_methods>
75
76 =item B<apply_method_modifiers>
77
78 =item B<apply_before_method_modifiers>
79
80 =item B<apply_after_method_modifiers>
81
82 =item B<apply_around_method_modifiers>
83
84 =item B<apply_override_method_modifiers>
85
86 =back
87
88 =head1 BUGS
89
90 All complex software has bugs lurking in it, and this module is no
91 exception. If you find a bug please either email me, or add the bug
92 to cpan-RT.
93
94 =head1 AUTHOR
95
96 Stevan Little E<lt>stevan@iinteractive.comE<gt>
97
98 =head1 COPYRIGHT AND LICENSE
99
100 Copyright 2006-2008 by Infinity Interactive, Inc.
101
102 L<http://www.iinteractive.com>
103
104 This library is free software; you can redistribute it and/or modify
105 it under the same terms as Perl itself.
106
107 =cut
108