use Moo::_Utils;
use B 'perlstring';
-our $VERSION = '0.009012'; # 0.9.12
+our $VERSION = '0.009013'; # 0.9.13
$VERSION = eval $VERSION;
our %MAKERS;
@{*{_getglob("${target}::ISA")}{ARRAY}} = @_;
};
*{_getglob("${target}::with")} = sub {
- { local $@; require Moo::Role; }
+ require Moo::Role;
die "Only one role supported at a time by with" if @_ > 1;
Moo::Role->apply_role_to_package($target, $_[0]);
};
*{_getglob("${target}::has")} = sub {
my ($name, %spec) = @_;
($MAKERS{$target}{accessor} ||= do {
- { local $@; require Method::Generate::Accessor; }
+ require Method::Generate::Accessor;
Method::Generate::Accessor->new
})->generate_method($target, $name, \%spec);
$class->_constructor_maker_for($target)
};
foreach my $type (qw(before after around)) {
*{_getglob "${target}::${type}"} = sub {
- { local $@; require Class::Method::Modifiers; }
+ require Class::Method::Modifiers;
_install_modifier($target, $type, @_);
};
}
{
no strict 'refs';
@{"${target}::ISA"} = do {
- {; local $@; require Moo::Object; } ('Moo::Object');
+ require Moo::Object; ('Moo::Object');
} unless @{"${target}::ISA"};
}
}
my ($class, $target, $select_super) = @_;
return unless $MAKERS{$target};
$MAKERS{$target}{constructor} ||= do {
- {
- local $@;
- require Method::Generate::Constructor;
- require Sub::Defer;
- }
+ require Method::Generate::Constructor;
+ require Sub::Defer;
my ($moo_constructor, $con);
if ($select_super && $MAKERS{$select_super}) {
->new(
package => $target,
accessor_generator => do {
- { local $@; require Method::Generate::Accessor; }
+ require Method::Generate::Accessor;
Method::Generate::Accessor->new;
},
construction_string => (
This method should always return a hash reference of named options.
-=head2 BUILDALL
+=head2 BUILD
-Don't override (or probably even call) this method. Instead, you can define
-a C<BUILD> method on your class and the constructor will automatically call the
-C<BUILD> method from parent down to child after the object has been
-instantiated. Typically this is used for object validation or possibly logging.
+Define a C<BUILD> method on your class and the constructor will automatically
+call the C<BUILD> method from parent down to child after the object has
+been instantiated. Typically this is used for object validation or possibly
+logging.
-=head2 DESTROY
+=head2 DEMOLISH
If you have a C<DEMOLISH> method anywhere in your inheritance hierarchy,
a C<DESTROY> method is created on first object construction which will call