Applying constraints using custom accessors?
I am enjoying using Class::Tiny! I would like to add type constraints to my setters to enforce preconditions early. It is easy, but repetitive, to copy the sample accessor from the C::T POD and add a constraint check. Is there already a module or C::T feature that does that? I looked on CPAN but couldn't find one. For example, Class::Tiny::Antlers does not provide isa.
If there is an existing way or module, would you be willing to update the C::T POD to reference it? If not, I will write Class::Tiny::ConstrainedAccessor and then send a PR for the POD. Thanks for considering this question and request!
In progress at https://github.com/cxw42/Class-Tiny-ConstrainedAccessor
Thanks