1 package DBIx::Class::DeploymentHandler::WithApplicatorDumple;
3 use MooseX::Role::Parameterized;
4 use Module::Runtime 'use_module';
5 use namespace::autoclean;
7 # this is at least a little ghetto and not super well
8 # thought out. Take a look at the following at some
9 # point to clean it all up:
11 # http://search.cpan.org/~jjnapiork/MooseX-Role-BuildInstanceOf-0.06/lib/MooseX/Role/BuildInstanceOf.pm
12 # http://github.com/rjbs/role-subsystem/blob/master/lib/Role/Subsystem.pm
14 parameter interface_role => (
19 parameter class_name => (
24 parameter delegate_name => (
29 parameter attributes_to_copy => (
30 isa => 'ArrayRef[Str]',
34 parameter attributes_to_assume => (
35 isa => 'ArrayRef[Str]',
42 my $class_name = $p->class_name;
44 use_module($class_name);
46 my $meta = Class::MOP::class_of($class_name);
48 has $_->name => %{ $_->clone }
49 for grep { $_ } map $meta->find_attribute_by_name($_), @{ $p->attributes_to_copy };
51 has $p->delegate_name => (
54 does => $p->interface_role,
55 handles => $p->interface_role,
58 method '_build_'.$p->delegate_name => sub {
62 map { $_ => $self->$_ }
63 @{ $p->attributes_to_assume },
64 @{ $p->attributes_to_copy },
71 # vim: ts=2 sw=2 expandtab