Beginning of dzilization
[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
04e05413 6our $AUTHORITY = 'cpan:STEVAN';
7
8b9641b8 8use Moose::Role;
9
10with 'Moose::Meta::Method::Accessor::Native::Writer';
04e05413 11
04e05413 12sub _constraint_must_be_checked {
13 my $self = shift;
14
15 my $attr = $self->associated_attribute;
16
17 return $attr->has_type_constraint
1e2c801e 18 && ($attr->type_constraint->name =~ /^(?:Num|Int)$/
19 || ($attr->should_coerce && $attr->type_constraint->has_coercion)
20 );
04e05413 21}
22
8b9641b8 23no Moose::Role;
04e05413 24
251;