package App::SCS::Web;

use Safe::Isa;
use Web::Simple;

has app => (is => 'ro', weak_ref => 1, required => 1);

has _page_dispatchers => (is => 'lazy');

sub _build__page_dispatchers {
  my ($self) = @_;
  [ map $_->page_dispatchers, reverse @{$self->app->plugins} ]
}

has _page_dispatchers => (is => 'lazy');

sub _build__page_dispatchers {
  my ($self) = @_;
  [ map $_->page_dispatchers, reverse @{$self->app->plugins} ]
}

sub dispatch_request {
  my ($self) = @_;
  return @{$self->_page_dispatchers};
}

1;
