use B 'perlstring';
use Sub::Defer ();
-our $VERSION = '0.091004'; # 0.91.4
+our $VERSION = '0.091007'; # 0.91.7
$VERSION = eval $VERSION;
require Moo::sification;
grep defined, map Mouse::Util::find_meta($_), @_
] if $INC{"Mouse.pm"};
$class->_maybe_reset_handlemoose($target);
+ return;
};
_install_coderef "${target}::with" => "Moo::with" => sub {
require Moo::Role;
$class->_accessor_maker_for($target)
->generate_method($target, $name, \%spec);
$class->_maybe_reset_handlemoose($target);
+ return;
};
foreach my $type (qw(before after around)) {
_install_coderef "${target}::${type}" => "Moo::${type}" => sub {
require Class::Method::Modifiers;
_install_modifier($target, $type, @_);
+ return;
};
}
{
=item * is
-B<required>, may be C<ro>, C<rw>, C<lazy> or C<rwp>.
+B<required>, may be C<ro>, C<lazy>, C<rwp> or C<rw>.
C<ro> generates an accessor that dies if you attempt to write to it - i.e.
a getter only - by defaulting C<reader> to the name of the attribute.
-C<rw> generates a normal getter/setter by defauting C<accessor> to the
-name of the attribute.
-
C<lazy> generates a reader like C<ro>, but also sets C<lazy> to 1 and
C<builder> to C<_build_${attribute_name}> to allow on-demand generated
attributes. This feature was my attempt to fix my incompetence when
from inside of the class, but read-only from outside.
This feature comes from L<MooseX::AttributeShortcuts>.
+C<rw> generates a normal getter/setter by defaulting C<accessor> to the
+name of the attribute.
+
=item * isa
Takes a coderef which is meant to validate the attribute. Unlike L<Moose> Moo
will return an appropriate metaclass pre-populated by L<Moo>.
-No support for C<super>, C<override>, C<inner>, or C<augment> - override can
-be handled by around albeit with a little more typing, and the author considers
-augment to be a bad idea.
+No support for C<super>, C<override>, C<inner>, or C<augment> - the author
+considers augment to be a bad idea, and override can be translated:
+
+ override foo => sub {
+ ...
+ super();
+ ...
+ };
+
+ around foo => sub {
+ my ($orig, $self) = (shift, shift);
+ ...
+ $self->$orig(@_);
+ ...
+ };
The C<dump> method is not provided by default. The author suggests loading
L<Devel::Dwarn> into C<main::> (via C<perl -MDevel::Dwarn ...> for example) and