added note that trigger also triggers on constructor
[gitmo/Moo.git] / lib / Moo.pm
index 19f5327..6450df8 100644 (file)
@@ -4,9 +4,11 @@ use strictures 1;
 use Moo::_Utils;
 use B 'perlstring';
 
-our $VERSION = '0.009013'; # 0.9.13
+our $VERSION = '0.009_015'; # 0.9.15
 $VERSION = eval $VERSION;
 
+require Moo::sification;
+
 our %MAKERS;
 
 sub import {
@@ -21,8 +23,7 @@ sub import {
   };
   *{_getglob("${target}::with")} = sub {
     require Moo::Role;
-    die "Only one role supported at a time by with" if @_ > 1;
-    Moo::Role->apply_role_to_package($target, $_[0]);
+    Moo::Role->apply_roles_to_package($target, $_[0]);
   };
   $MAKERS{$target} = {};
   *{_getglob("${target}::has")} = sub {
@@ -46,6 +47,9 @@ sub import {
       require Moo::Object; ('Moo::Object');
     } unless @{"${target}::ISA"};
   }
+  if ($INC{'Moo/HandleMoose.pm'}) {
+    Moo::HandleMoose::inject_fake_metaclass_for($target);
+  }
 }
 
 sub _constructor_maker_for {
@@ -321,8 +325,9 @@ Takes a hashref
 
 =item * trigger
 
-Takes a coderef which will get called any time the attribute is set. Coderef
-will be invoked against the object with the new value as an argument.
+Takes a coderef which will get called any time the attribute is set. This
+includes the constructor. Coderef will be invoked against the object with the
+new value as an argument.
 
 Note that Moose also passes the old value, if any; this feature is not yet
 supported.
@@ -454,7 +459,8 @@ API will encourage the use of other type systems as well, since it's
 probably the weakest part of Moose design-wise.
 
 C<initializer> is not supported in core since the author considers it to be a
-bad idea but may be supported by an extension in future.
+bad idea but may be supported by an extension in future. Meanwhile C<trigger> or
+C<coerce> are more likely to be able to fulfill your needs.
 
 There is no meta object.  If you need this level of complexity you wanted
 L<Moose> - Moo succeeds at being small because it explicitly does not
@@ -464,6 +470,10 @@ 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.
 
+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
+using C<$obj-E<gt>$::Dwarn()> instead.
+
 L</default> only supports coderefs, because doing otherwise is usually a
 mistake anyway.
 
@@ -534,6 +544,8 @@ ajgb - Alex J. G. BurzyƄski (cpan:AJGB) <ajgb@cpan.org>
 
 doy - Jesse Luehrs (cpan:DOY) <doy at tozt dot net>
 
+perigrin - Chris Prather (cpan:PERIGRIN) <chris@prather.org>
+
 =head1 COPYRIGHT
 
 Copyright (c) 2010-2011 the Moo L</AUTHOR> and L</CONTRIBUTORS>