1 package DBIx::Class::DeploymentHandler::WithApplicatorDumple;
2 use MooseX::Role::Parameterized;
4 use namespace::autoclean;
6 # this is at least a little ghetto and not super well
7 # thought out. Take a look at the following at some
8 # point to clean it all up:
10 # http://search.cpan.org/~jjnapiork/MooseX-Role-BuildInstanceOf-0.06/lib/MooseX/Role/BuildInstanceOf.pm
11 # http://github.com/rjbs/role-subsystem/blob/master/lib/Role/Subsystem.pm
13 parameter interface_role => (
18 parameter class_name => (
23 parameter delegate_name => (
28 parameter attributes_to_copy => (
29 isa => 'ArrayRef[Str]',
33 parameter attributes_to_assume => (
34 isa => 'ArrayRef[Str]',
41 my $class_name = $p->class_name;
43 Class::MOP::load_class($class_name);
45 my $meta = Class::MOP::class_of($class_name);
47 has $_->name => %{ $_->clone }
48 for grep { $_ } map $meta->find_attribute_by_name($_), @{ $p->attributes_to_copy };
50 has $p->delegate_name => (
53 does => $p->interface_role,
54 handles => $p->interface_role,
57 method '_build_'.$p->delegate_name => sub {
61 map { $_ => $self->$_ }
62 @{ $p->attributes_to_assume },
63 @{ $p->attributes_to_copy },
70 # vim: ts=2 sw=2 expandtab