Use dzil Authority plugin - remove $AUTHORITY from code
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Counter / Writer.pm
1 package Moose::Meta::Method::Accessor::Native::Counter::Writer;
2
3 use strict;
4 use warnings;
5
6 use Moose::Role;
7
8 with 'Moose::Meta::Method::Accessor::Native::Writer';
9
10 sub _constraint_must_be_checked {
11     my $self = shift;
12
13     my $attr = $self->associated_attribute;
14
15     return $attr->has_type_constraint
16         && ($attr->type_constraint->name =~ /^(?:Num|Int)$/
17          || ($attr->should_coerce && $attr->type_constraint->has_coercion)
18            );
19 }
20
21 no Moose::Role;
22
23 1;