constraint_generatorAnd I don't quite get it, even while looking at the source for "Ref" in Types::Standard. I do understand that my type will need a constraint_generator coderef, and it can either return a closure that will do the constraint checking, or it can return a Type::Tiny object.Coderef that generates a new constraint coderef based on parameters. Alternatively, the constraint generator can return a fully-formed Type::Tiny object, in which case the name_generator, inline_generator, and coercion_generator attributes documented below are ignored.
Optional; providing a generator makes this type into a parameterizable type constraint.
It seems like returning a Type::Tiny object is "easier", assuming one could re-use Ref from Types::Standard, but the semi-recursive nature of it is confusing me. Anyone care to post a working example of a custom parameterizable Type::Tiny constraint?
Edit OK, I admit it, I am really converting MooseX::DBIx::Class::Type to a Type::Tiny library, and am hung up on not using MooseX::Types::Parameterizable. I think I can figure it out...
In reply to How to create a parameterizable Type::Tiny constraint by Yary
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |