factor out child code into PageChildren and add an all_paths method to PageSet
[scpubgit/SCS.git] / lib / SCSite / PageChildren.pm
CommitLineData
cbb06a72 1package SCSite::PageChildren;
2
3use Moo::Role;
4
5requires '_page_set_class';
6requires '_top_dir';
7requires '_my_path';
8
9sub children {
10 my ($self, %args) = @_;
11 if (my $at = delete $args{at_depth}) {
12 @args{qw(min_depth max_depth)} = ($at, $at);
13 }
14 $self->_page_set_class->new(
15 top_dir => $self->_top_dir,
16 base_dir => $self->_my_path,
17 max_depth => 1,
18 %args,
19 );
20}
21
221;