return 1;
}
-sub verify_type_constraint {
+sub verify_against_type_constraint {
return 1 unless $_[0]->{type_constraint};
local $_ = $_[1];
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.
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};
$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;
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');