X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FSet%2FPath.pm;h=8cd762c34ef55df37281ddcacb3d8a75e5bc1d0a;hb=f54cadb836315572aa2c4bcb16f221da1687df7a;hp=86dfe446cf4a7504cc8357006b0d0a8c1d2e7afd;hpb=0f9d7c1a2d11bc7001fe450cb2086e67c13a39e9;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Set/Path.pm b/lib/LaTeX/TikZ/Set/Path.pm index 86dfe44..8cd762c 100644 --- a/lib/LaTeX/TikZ/Set/Path.pm +++ b/lib/LaTeX/TikZ/Set/Path.pm @@ -9,18 +9,18 @@ LaTeX::TikZ::Set::Path - A set object representing a path. =head1 VERSION -Version 0.01 +Version 0.02 =cut -our $VERSION = '0.01'; +our $VERSION = '0.02'; 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}, @_;