This can't work and won't work until generated components do a role. I need that...
[catagits/CatalystX-DynamicComponent.git] / lib / CatalystX / DynamicControllerIntrospection.pm
CommitLineData
68e89186 1package CatalystX::Dynamic::ControllerIntrospection;
2use Moose;
3use MooseX::Types::Moose qw/ArrayRef/;
4use namespace::autoclean;
5
6# SYNOPSIS: Provide catalyst controller introspection as a model.
7
8for my $name (qw/ classes roles /) {
9
10 has "limit_to_$name" => (
11 isa => ArrayRef, is => 'ro', default => sub { [] },
12 predicate => "_should_limit_to_$name",
13 );
14
15}
16
17sub list_controllers {
18 my ($self, $app) = @_;
19 my @controllers = grep { 1 } $app->controllers;
20}
21
22__PACKAGE__->meta->make_immutable;
23