[Moose-commits] r7683 - in Moose/trunk/lib: . Moose/Meta
autarch at code2.0beta.co.uk
autarch at code2.0beta.co.uk
Sat Feb 14 17:40:32 GMT 2009
Author: autarch
Date: 2009-02-14 09:40:31 -0800 (Sat, 14 Feb 2009)
New Revision: 7683
Modified:
Moose/trunk/lib/Moose.pm
Moose/trunk/lib/Moose/Meta/Attribute.pm
Log:
Non-inlined trigger code no longer passes the meta-attr object, and updated the docs to match
Modified: Moose/trunk/lib/Moose/Meta/Attribute.pm
===================================================================
--- Moose/trunk/lib/Moose/Meta/Attribute.pm 2009-02-14 17:26:29 UTC (rev 7682)
+++ Moose/trunk/lib/Moose/Meta/Attribute.pm 2009-02-14 17:40:31 UTC (rev 7683)
@@ -509,7 +509,7 @@
}
if ($self->has_trigger) {
- $self->trigger->($instance, $value, $self);
+ $self->trigger->($instance, $value);
}
}
Modified: Moose/trunk/lib/Moose.pm
===================================================================
--- Moose/trunk/lib/Moose.pm 2009-02-14 17:26:29 UTC (rev 7682)
+++ Moose/trunk/lib/Moose.pm 2009-02-14 17:40:31 UTC (rev 7683)
@@ -474,11 +474,10 @@
=item I<trigger =E<gt> $code>
-The I<trigger> option is a CODE reference which will be called after the value of
-the attribute is set. The CODE ref will be passed the instance itself, the
-updated value and the attribute meta-object (this is for more advanced fiddling
-and can typically be ignored). You B<cannot> have a trigger on a read-only
-attribute.
+The I<trigger> option is a CODE reference which will be called after
+the value of the attribute is set. The CODE ref will be passed the
+instance itself and the updated value. You B<cannot> have a trigger on
+a read-only attribute.
B<NOTE:> Triggers will only fire when you B<assign> to the attribute,
either in the constructor, or using the writer. Default and built values will
More information about the Moose-commits
mailing list