package SCSite::PageChildren;

use Moo::Role;

requires '_page_set_class';
requires '_top_dir';
requires '_my_path';

sub children {
  my ($self, %args) = @_;
  if (my $at = delete $args{at_depth}) {
    @args{qw(min_depth max_depth)} = ($at, $at);
  }
  $self->_page_set_class->new(
    top_dir => $self->_top_dir,
    base_dir => $self->_my_path,
    max_depth => 1,
    %args,
  );
}

1;
