[Moose-commits] r7149 - in Mouse/trunk: . lib/Mouse lib/Mouse/Meta t

sartak at code2.0beta.co.uk sartak at code2.0beta.co.uk
Mon Dec 22 02:53:05 GMT 2008


Author: sartak
Date: 2008-12-21 18:53:05 -0800 (Sun, 21 Dec 2008)
New Revision: 7149

Modified:
   Mouse/trunk/
   Mouse/trunk/lib/Mouse/Meta/Attribute.pm
   Mouse/trunk/lib/Mouse/Object.pm
   Mouse/trunk/t/101-meta-attribute.t
Log:
 r77745 at onn:  sartak | 2008-12-21 21:52:52 -0500
 Rename the method to verify_against_type_constraint since Moose renamed it too



Property changes on: Mouse/trunk
___________________________________________________________________
Name: svk:merge
   - 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77741
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
   + 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77745
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997

Modified: Mouse/trunk/lib/Mouse/Meta/Attribute.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Attribute.pm	2008-12-22 02:52:12 UTC (rev 7148)
+++ Mouse/trunk/lib/Mouse/Meta/Attribute.pm	2008-12-22 02:53:05 UTC (rev 7149)
@@ -323,7 +323,7 @@
     return 1;
 }
 
-sub verify_type_constraint {
+sub verify_against_type_constraint {
     return 1 unless $_[0]->{type_constraint};
 
     local $_ = $_[1];
@@ -470,7 +470,7 @@
 Returns a code reference which can be used to check that a given value passes
 this attribute's type constraint;
 
-=head2 verify_type_constraint Item -> 1 | ERROR
+=head2 verify_against_type_constraint Item -> 1 | ERROR
 
 Checks that the given value passes this attribute's type constraint. Returns 1
 on success, otherwise C<confess>es.

Modified: Mouse/trunk/lib/Mouse/Object.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Object.pm	2008-12-22 02:52:12 UTC (rev 7148)
+++ Mouse/trunk/lib/Mouse/Object.pm	2008-12-22 02:53:05 UTC (rev 7149)
@@ -19,8 +19,7 @@
         if (defined($from) && exists($args->{$from})) {
             $args->{$from} = $attribute->coerce_constraint($args->{$from})
                 if $attribute->should_coerce;
-            $attribute->verify_type_constraint($args->{$from})
-                if $attribute->has_type_constraint;
+            $attribute->verify_against_type_constraint($args->{$from});
 
             $instance->{$key} = $args->{$from};
 
@@ -44,8 +43,7 @@
 
                     $value = $attribute->coerce_constraint($value)
                         if $attribute->should_coerce;
-                    $attribute->verify_type_constraint($value)
-                        if $attribute->has_type_constraint;
+                    $attribute->verify_against_type_constraint($value);
 
                     $instance->{$key} = $value;
 

Modified: Mouse/trunk/t/101-meta-attribute.t
===================================================================
--- Mouse/trunk/t/101-meta-attribute.t	2008-12-22 02:52:12 UTC (rev 7148)
+++ Mouse/trunk/t/101-meta-attribute.t	2008-12-22 02:53:05 UTC (rev 7149)
@@ -30,4 +30,4 @@
 is($attr->clearer, 'clear_pawn', 'clearer');
 ok(!$attr->is_lazy_build, "not lazy_build");
 is(ref($attr->default), 'CODE', 'default is a coderef');
-ok($attr->verify_type_constraint(1), 'verify_type_constraint works even without isa');
+ok($attr->verify_against_type_constraint(1), 'verify_against_type_constraint works even without isa');




More information about the Moose-commits mailing list