]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Set/Union.pm
Introduce the ->begin and ->end path methods
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Set / Union.pm
index 2648d3d77223810556025bdb637b234fca8ff056..13b5dc64c0623fb0d590eacce9de636f231ec816 100644 (file)
@@ -24,13 +24,13 @@ use Any::Moose;
 
 =head1 RELATIONSHIPS
 
-This class consumes the L<LaTeX::TikZ::Set::Path> and L<LaTeX::TikZ::Set::Mutable> roles, and as such implements the L</path> and L</add> methods.
+This class consumes the L<LaTeX::TikZ::Set::Path> and L<LaTeX::TikZ::Set::Container> roles, and as such implements the L</path>, L</kids> and L</add> methods.
 
 =cut
 
 with qw<
  LaTeX::TikZ::Set::Path
- LaTeX::TikZ::Set::Mutable
+ LaTeX::TikZ::Set::Container
 >;
 
 =head1 ATTRIBUTES
@@ -78,6 +78,32 @@ sub path {
  join ' ', map $_->path(@_), $set->kids;
 }
 
+=head2 C<begin>
+
+=cut
+
+sub begin {
+ my $set = shift;
+
+ my @kids = $set->kids;
+ return undef unless @kids;
+
+ $kids[0]->begin;
+}
+
+=head2 C<end>
+
+=cut
+
+sub end {
+ my $set = shift;
+
+ my @kids = $set->kids;
+ return undef unless @kids;
+
+ $kids[-1]->end;
+}
+
 LaTeX::TikZ::Interface->register(
  union => sub {
   shift;
@@ -97,7 +123,7 @@ __PACKAGE__->meta->make_immutable;
 
 =head1 SEE ALSO
 
-L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Path>, L<LaTeX::TikZ::Set::Mutable>.
+L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Path>, L<LaTeX::TikZ::Set::Container>.
 
 =head1 AUTHOR