From: Dave Rolsky Date: Sat, 14 Feb 2009 17:40:31 +0000 (+0000) Subject: Non-inlined trigger code no longer passes the meta-attr object, and updated the docs... X-Git-Tag: 0.70~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=525129a5a7413b8c2ea745d170a1913e93bfd4bf;p=gitmo%2FMoose.git Non-inlined trigger code no longer passes the meta-attr object, and updated the docs to match --- diff --git a/lib/Moose.pm b/lib/Moose.pm index 3c98211..81b1df0 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -474,11 +474,10 @@ This is only legal if your C option is either C or C. =item I $code> -The I 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 have a trigger on a read-only -attribute. +The I 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 have a trigger on +a read-only attribute. B Triggers will only fire when you B to the attribute, either in the constructor, or using the writer. Default and built values will diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 7b4aed6..7111abc 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -509,7 +509,7 @@ sub set_value { } if ($self->has_trigger) { - $self->trigger->($instance, $value, $self); + $self->trigger->($instance, $value); } }