Commit | Line | Data |
04e05413 |
1 | package Moose::Meta::Method::Accessor::Native::Counter::Writer; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
8b9641b8 |
6 | use Moose::Role; |
7 | |
8 | with 'Moose::Meta::Method::Accessor::Native::Writer'; |
04e05413 |
9 | |
04e05413 |
10 | sub _constraint_must_be_checked { |
11 | my $self = shift; |
12 | |
13 | my $attr = $self->associated_attribute; |
14 | |
15 | return $attr->has_type_constraint |
1e2c801e |
16 | && ($attr->type_constraint->name =~ /^(?:Num|Int)$/ |
17 | || ($attr->should_coerce && $attr->type_constraint->has_coercion) |
18 | ); |
04e05413 |
19 | } |
20 | |
8b9641b8 |
21 | no Moose::Role; |
04e05413 |
22 | |
23 | 1; |