summaryrefslogtreecommitdiff
path: root/lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm')
-rw-r--r--lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm b/lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm
new file mode 100644
index 0000000..55ab4a7
--- /dev/null
+++ b/lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm
@@ -0,0 +1,24 @@
+package Moose::Meta::Method::Accessor::Native::Counter::Writer;
+our $VERSION = '2.1405';
+
+use strict;
+use warnings;
+
+use Moose::Role;
+
+with 'Moose::Meta::Method::Accessor::Native::Writer';
+
+sub _constraint_must_be_checked {
+ my $self = shift;
+
+ my $attr = $self->associated_attribute;
+
+ return $attr->has_type_constraint
+ && ($attr->type_constraint->name =~ /^(?:Num|Int)$/
+ || ($attr->should_coerce && $attr->type_constraint->has_coercion)
+ );
+}
+
+no Moose::Role;
+
+1;