package Tak::MetaService;

use Moo;

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

sub handle_register {
  my ($self, $name, $class, @args) = @_;
  (my $file = $class) =~ s/::/\//g;
  require "${file}.pm";
  my $new = $class->new(@args);
  $self->router->register($name => $new);
  return SUCCESS => "Registered ${name}";
}

1;
