# Moose compatible methods/functions
-package Mouse::Meta::Module;
+package
+ Mouse::Meta::Module;
sub version { no strict 'refs'; ${shift->name.'::VERSION'} }
sub authority { no strict 'refs'; ${shift->name.'::AUTHORITY'} }
);
}
+package
+ Mouse::Meta::Role;
-package Mouse::Util::TypeConstraints;
+for my $modifier_type (qw/before after around/) {
+ my $modifier = "${modifier_type}_method_modifiers";
+ my $has_method_modifiers = sub{
+ my($self, $method_name) = @_;
+ my $m = $self->{$modifier}->{$method_name};
+ return $m && @{$m} != 0;
+ };
+
+ no strict 'refs';
+ *{ 'has_' . $modifier_type . '_method_modifiers' } = $has_method_modifiers;
+}
+
+
+sub has_override_method_modifier {
+ my ($self, $method_name) = @_;
+ return exists $self->{override_method_modifiers}->{$method_name};
+}
+
+sub get_method_modifier_list {
+ my($self, $modifier_type) = @_;
+
+ return keys %{ $self->{$modifier_type . '_method_modifiers'} };
+}
+
+package
+ Mouse::Util::TypeConstraints;
use Mouse::Util::TypeConstraints ();
return;
}
-package Mouse::Meta::Attribute;
+package
+ Mouse::Meta::Attribute;
sub applied_traits{ $_[0]->{traits} } # TEST ONLY
sub has_applied_traits{ exists $_[0]->{traits} } # TEST ONLY
+sub has_documentation{ exists $_[0]->{documentation} } # TEST ONLY
+sub documentation{ $_[0]->{documentation} } # TEST ONLY
+
1;
__END__