And makes it require kids().
lib/LaTeX/TikZ/Set/Arc.pm
lib/LaTeX/TikZ/Set/Arrow.pm
lib/LaTeX/TikZ/Set/Circle.pm
+lib/LaTeX/TikZ/Set/Container.pm
lib/LaTeX/TikZ/Set/Line.pm
-lib/LaTeX/TikZ/Set/Mutable.pm
lib/LaTeX/TikZ/Set/Path.pm
lib/LaTeX/TikZ/Set/Point.pm
lib/LaTeX/TikZ/Set/Polyline.pm
}
}
- my @subsets = ($set->isa('LaTeX::TikZ::Set::Sequence')
- || $set->isa('LaTeX::TikZ::Set::Union'))
- ? $set->kids
- : ();
+ my @subsets = $set->does('LaTeX::TikZ::Set::Container')
+ ? $set->kids
+ : ();
$find_mods_rec->($_, $layers, $others) for @subsets;
});
-package LaTeX::TikZ::Set::Mutable;
+package LaTeX::TikZ::Set::Container;
use strict;
use warnings;
=head1 NAME
-LaTeX::TikZ::Set::Mutable - A role for set objects that can be appended to.
+LaTeX::TikZ::Set::Container - A role for set objects that are made of subobjects.
=head1 VERSION
=head1 DESCRIPTION
-L<LaTeX::TikZ::Set> objects that are mutable consume this role.
-This forces them to implement an C<add> method describing how more elements can be added to the set.
+L<LaTeX::TikZ::Set> objects that group other objects together consume this role.
+This forces them to implement :
+
+=over 4
+
+=item *
+
+a C<kids> method that returns the list of subobjects ;
+
+=item *
+
+an C<add> method describing how more elements can be added to the set.
+
+=back
=cut
requires qw<
add
+ kids
>;
=head1 SEE ALSO
=cut
-1; # End of LaTeX::TikZ::Set::Mutable
+1; # End of LaTeX::TikZ::Set::Container
=head1 RELATIONSHIPS
-This class consumes the L<LaTeX::TikZ::Set> and L<LaTeX::TikZ::Set::Mutable> roles, and as such implements the L</draw> and L</add> methods.
+This class consumes the L<LaTeX::TikZ::Set> and L<LaTeX::TikZ::Set::Container> roles, and as such implements the L</draw>, L</kids> and L</add> methods.
=cut
with qw<
LaTeX::TikZ::Set
- LaTeX::TikZ::Set::Mutable
+ LaTeX::TikZ::Set::Container
>;
subtype 'LaTeX::TikZ::Set::Sequence::Elements'
=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
=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
=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
use_ok( 'LaTeX::TikZ::Set::Arc' );
use_ok( 'LaTeX::TikZ::Set::Arrow' );
use_ok( 'LaTeX::TikZ::Set::Circle' );
+ use_ok( 'LaTeX::TikZ::Set::Container' );
use_ok( 'LaTeX::TikZ::Set::Line' );
- use_ok( 'LaTeX::TikZ::Set::Mutable' );
use_ok( 'LaTeX::TikZ::Set::Path' );
use_ok( 'LaTeX::TikZ::Set::Point' );
use_ok( 'LaTeX::TikZ::Set::Polyline' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Arc' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Arrow' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Circle' );
+pod_coverage_ok( 'LaTeX::TikZ::Set::Container' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Line' );
-pod_coverage_ok( 'LaTeX::TikZ::Set::Mutable' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Path' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Point' );
pod_coverage_ok( 'LaTeX::TikZ::Set::Polyline' );