1 package CatalystX::ModelToControllerReflector::ControllerRole;
3 use Moose::Util qw/find_meta/;
4 use namespace::autoclean;
6 sub get_reflected_action_methods {
8 my $meta = find_meta($self);
10 map { $self->_smash_method_attributes($_) }
11 grep { ! /^(_.*|new|meta|get_(reflected_)?action_methods)$/ }
12 # FIXME - giant turd, right there.
13 $meta->get_method_list; # we need to apply a role to the
14 # metaclass of each method we generate,
15 # and then test for that role being done
16 # by the method in question here.
17 # Should probably also check they supports
18 # attributes and shit self if not.
21 # EPIC CHEAT to just smash the attribute definition :)
22 sub _smash_method_attributes {
23 my ($self, $name) = @_;
24 my $meta = find_meta($self);
26 my $m = $meta->get_method($name);
27 $m->meta->get_attribute('attributes')->set_value($m, ['Local']);
31 around get_action_methods => sub {
35 return ($self->get_reflected_action_methods, $self->$orig(@_));