And of course, our coercions do nothing unless they are told to,
like so:
-
+
has 'base' => (is => 'rw', isa => 'Uri', coerce => 1);
has 'uri' => (is => 'rw', isa => 'Uri', coerce => 1);
consistent and very flexible API across multiple accessors.
=head1 CONCLUSION
-
+
This recipe illustrated the power of coercions to build a more
flexible and open API for your accessors, while still retaining
all the safety that comes from using Moose's type constraints.