« blib/lib/Moose/Exception/OverloadRequiresNamesForCoderef.pm
↑ Summary
blib/lib/Class/MOP/Class/Immutable/Trait.pm »
| 1 | package Moose::Meta::Method::Accessor::Native::Counter::Writer; | ||
| 2 | our $VERSION = '2.4001'; | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | |||
| 7 | use Moose::Role; | ||
| 8 | |||
| 9 | with 'Moose::Meta::Method::Accessor::Native::Writer'; | ||
| 10 | |||
| 11 | sub _constraint_must_be_checked { | ||
| 12 | my $self = shift; | ||
| 13 | |||
| 14 | my $attr = $self->associated_attribute; | ||
| 15 | |||
| 16 | return $attr->has_type_constraint | ||
| 17 | && ($attr->type_constraint->name =~ /^(?:Num|Int)$/ | ||
| 18 | || ($attr->should_coerce && $attr->type_constraint->has_coercion) | ||
| 19 | ); | ||
| 20 | } | ||
| 21 | |||
| 22 | no Moose::Role; | ||
| 23 | |||
| 24 | 1; |