X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FSet%2FPath.pm;h=d9a9799bd9efde2c2dc7d283c9dc8566b2ed92f9;hp=86dfe446cf4a7504cc8357006b0d0a8c1d2e7afd;hb=d9b3236d7adf9b87cebe8f956539469d42b9aef9;hpb=37b2cca5547d02b2a751a26f9949d492b5002c2e diff --git a/lib/LaTeX/TikZ/Set/Path.pm b/lib/LaTeX/TikZ/Set/Path.pm index 86dfe44..d9a9799 100644 --- a/lib/LaTeX/TikZ/Set/Path.pm +++ b/lib/LaTeX/TikZ/Set/Path.pm @@ -18,9 +18,9 @@ our $VERSION = '0.01'; use LaTeX::TikZ::Interface; use LaTeX::TikZ::Functor; +use LaTeX::TikZ::Tools; + use Any::Moose; -use Any::Moose 'Util::TypeConstraints' - => [ qw/subtype as where find_type_constraint/ ]; =head1 RELATIONSHIPS @@ -41,13 +41,9 @@ The L objects that from the path. =cut -subtype 'LaTeX::TikZ::Set::Path::Elements' - => as 'Object' - => where { $_->does('LaTeX::TikZ::Set::Op') }; - has '_ops' => ( is => 'ro', - isa => 'Maybe[ArrayRef[LaTeX::TikZ::Set::Path::Elements]]', + isa => 'Maybe[ArrayRef[LaTeX::TikZ::Set::Op]]', init_arg => 'ops', default => sub { [ ] }, ); @@ -60,12 +56,12 @@ sub ops { @{$_[0]->_ops} } =cut -my $ltspe_tc = find_type_constraint('LaTeX::TikZ::Set::Path::Elements'); +my $ltso_tc = LaTeX::TikZ::Tools::type_constraint('LaTeX::TikZ::Set::Op'); sub add { my $set = shift; - $ltspe_tc->assert_valid($_) for @_; + $ltso_tc->assert_valid($_) for @_; push @{$set->_ops}, @_;