First hack at factoring the strategy out, broke the config munging test..
[catagits/CatalystX-DynamicComponent.git] / lib / CatalystX / DynamicComponent / ModelToControllerReflector / Strategy / InterfaceRoles.pm
CommitLineData
f38d3061 1package CatalystX::DynamicComponent::ModelToControllerReflector::Strategy::InterfaceRoles;
2use Moose;
3use MooseX::Types::Moose qw/HashRef/;
4use Moose::Autobox;
5use List::MoreUtils qw/uniq/;
6use namespace::autoclean;
7
8with 'CatalystX::DynamicComponent::ModelToControllerReflector::Strategy';
9
10sub get_reflected_method_list {;
11 my ($self, $app, $model_meta) = @_;
12 my $model_name = $model_meta->name;
13 my $interface_roles = [ uniq( map { exists $_->{interface_roles} ? $_->{interface_roles}->flatten : () } $app->config->{$model_name}, $app->config->{'CatalystX::DynamicComponent::ModelToControllerReflector'} ) ];
14
15 map { $_->meta->get_required_method_list } @$interface_roles;
16}
17
18__PACKAGE__->meta->make_immutable;
19