more cleanups
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Counter / Writer.pm
CommitLineData
04e05413 1package Moose::Meta::Method::Accessor::Native::Counter::Writer;
2
3use strict;
4use warnings;
5
245478d5 6our $VERSION = '1.19';
04e05413 7$VERSION = eval $VERSION;
8our $AUTHORITY = 'cpan:STEVAN';
9
8b9641b8 10use Moose::Role;
11
12with 'Moose::Meta::Method::Accessor::Native::Writer';
04e05413 13
04e05413 14sub _constraint_must_be_checked {
15 my $self = shift;
16
17 my $attr = $self->associated_attribute;
18
19 return $attr->has_type_constraint
1e2c801e 20 && ($attr->type_constraint->name =~ /^(?:Num|Int)$/
21 || ($attr->should_coerce && $attr->type_constraint->has_coercion)
22 );
04e05413 23}
24
8b9641b8 25no Moose::Role;
04e05413 26
271;