From: Vincent Pit Date: Wed, 21 Jul 2010 10:33:43 +0000 (+0200) Subject: Coerce Points into Set::Points X-Git-Tag: v0.01~34 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=1e3e6b3727cdc2b8ed3c5cbe9a4a36ac7a15c4a2;p=perl%2Fmodules%2FLaTeX-TikZ.git Coerce Points into Set::Points --- diff --git a/lib/LaTeX/TikZ/Set/Point.pm b/lib/LaTeX/TikZ/Set/Point.pm index c4749fe..0a4911f 100644 --- a/lib/LaTeX/TikZ/Set/Point.pm +++ b/lib/LaTeX/TikZ/Set/Point.pm @@ -18,16 +18,21 @@ our $VERSION = '0.01'; use LaTeX::TikZ::Point; use Any::Moose; +use Any::Moose 'Util::TypeConstraints'; with 'LaTeX::TikZ::Set::Op'; has 'point' => ( is => 'ro', - does => 'LaTeX::TikZ::Point::Autocoerce', + isa => 'LaTeX::TikZ::Point::Autocoerce', required => 1, coerce => 1, ); +coerce 'LaTeX::TikZ::Set::Point' + => from 'Any' + => via { __PACKAGE__->new(point => $_) }; + sub path { my ($set, $tikz) = @_;