1 package Moose::Meta::Role::Application;
8 our $AUTHORITY = 'cpan:STEVAN';
10 __PACKAGE__->meta->add_attribute('method_exclusions' => (
11 init_arg => 'excludes',
12 reader => 'get_method_exclusions',
17 my ($class, %params) = @_;
19 if (exists $params{excludes}) {
20 # I wish we had coercion here :)
21 $params{excludes} = (ref $params{excludes} eq 'ARRAY'
23 : [ $params{excludes} ]);
26 $class->meta->new_object(%params);
29 sub is_method_excluded {
30 my ($self, $method_name) = @_;
31 foreach (@{$self->get_method_exclusions}) {
32 return 1 if $_ eq $method_name;
40 $self->check_role_exclusions(@_);
41 $self->check_required_methods(@_);
42 $self->check_required_attributes(@_);
44 $self->apply_attributes(@_);
45 $self->apply_methods(@_);
47 $self->apply_override_method_modifiers(@_);
49 $self->apply_before_method_modifiers(@_);
50 $self->apply_around_method_modifiers(@_);
51 $self->apply_after_method_modifiers(@_);
54 sub check_role_exclusions { die "Abstract Method" }
55 sub check_required_methods { die "Abstract Method" }
56 sub check_required_attributes { die "Abstract Method" }
58 sub apply_attributes { die "Abstract Method" }
59 sub apply_methods { die "Abstract Method" }
60 sub apply_override_method_modifiers { die "Abstract Method" }
61 sub apply_method_modifiers { die "Abstract Method" }
63 sub apply_before_method_modifiers { (shift)->apply_method_modifiers('before' => @_) }
64 sub apply_around_method_modifiers { (shift)->apply_method_modifiers('around' => @_) }
65 sub apply_after_method_modifiers { (shift)->apply_method_modifiers('after' => @_) }
75 Moose::Meta::Role::Application
79 This is the abstract base class for role applications.
89 =item B<get_method_exclusions>
91 =item B<is_method_excluded>
95 =item B<check_role_exclusions>
97 =item B<check_required_methods>
99 =item B<check_required_attributes>
101 =item B<apply_attributes>
103 =item B<apply_methods>
105 =item B<apply_method_modifiers>
107 =item B<apply_before_method_modifiers>
109 =item B<apply_after_method_modifiers>
111 =item B<apply_around_method_modifiers>
113 =item B<apply_override_method_modifiers>
119 All complex software has bugs lurking in it, and this module is no
120 exception. If you find a bug please either email me, or add the bug
125 Stevan Little E<lt>stevan@iinteractive.comE<gt>
127 =head1 COPYRIGHT AND LICENSE
129 Copyright 2006-2008 by Infinity Interactive, Inc.
131 L<http://www.iinteractive.com>
133 This library is free software; you can redistribute it and/or modify
134 it under the same terms as Perl itself.