1 package Method::Generate::BuildAll;
4 use base qw(Moo::Object);
11 my ($self, $into) = @_;
12 quote_sub "${into}::BUILDALL", join '',
13 qq{ my \$self = shift;\n},
14 qq{ my \$class = ref \$self;\n},
15 ' if ('. perlstring($into) ." ne \$class) {\n",
16 qq{ return \$self->\${\\(\$Moo::Object::BUILD_MAKER->generate_method(\$class))}(\@_);\n},
18 $self->buildall_body_for($into, '$self', '@_'),
23 sub buildall_body_for {
24 my ($self, $into, $me, $args) = @_;
26 grep *{_getglob($_)}{CODE},
28 reverse @{mro::get_linear_isa($into)};
29 join '', map qq{ ${me}->${_}(${args});\n}, @builds;