X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FSet%2FPath.pm;fp=lib%2FLaTeX%2FTikZ%2FSet%2FPath.pm;h=b8d976827d04bd3431c7df07fed8d01c6295d2da;hb=263a93f34deb0f2e87e89d6186361c7232b61c04;hp=319298b3bd518dd87a2a213dff4910b3247f499c;hpb=c314e50ea7c67844e6cf5f4d1431d8bf41a39f1a;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Set/Path.pm b/lib/LaTeX/TikZ/Set/Path.pm index 319298b..b8d9768 100644 --- a/lib/LaTeX/TikZ/Set/Path.pm +++ b/lib/LaTeX/TikZ/Set/Path.pm @@ -15,30 +15,34 @@ Version 0.01 our $VERSION = '0.01'; -use LaTeX::TikZ::Tools; - use Any::Moose; +use Any::Moose 'Util::TypeConstraints' + => [ qw/subtype as where find_type_constraint/ ]; with qw( LaTeX::TikZ::Set::Op LaTeX::TikZ::Set::Mutable ); +subtype 'LaTeX::TikZ::Set::Path::Elements' + => as 'Object' + => where { $_->does('LaTeX::TikZ::Set::Op') }; + has '_ops' => ( is => 'ro', - isa => 'Maybe[ArrayRef[LaTeX::TikZ::Set::Op]]', + isa => 'Maybe[ArrayRef[LaTeX::TikZ::Set::Path::Elements]]', init_arg => 'ops', default => sub { [ ] }, ); sub ops { @{$_[0]->_ops} } -my $ltso_tc = LaTeX::TikZ::Tools::type_constraint('LaTeX::TikZ::Set::Op'); +my $ltspe_tc = find_type_constraint('LaTeX::TikZ::Set::Path::Elements'); sub add { my $set = shift; - $ltso_tc->check($_) for @_; + $ltspe_tc->check($_) for @_; push @{$_[0]->_ops}, @_;