X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Dispatcher.pm;h=7c4b0a60618c10eaa56180bf1dcd9729102c38b9;hb=0d63bf9da52cdfe2c9d8850b690032ff539b6398;hp=a96c32e164843fda69c1998d5b18abad2f89fa4f;hpb=a4667cce6415476312d6932f92f89fb28101ab88;p=NDIRC.git diff --git a/Dispatcher.pm b/Dispatcher.pm index a96c32e..7c4b0a6 100644 --- a/Dispatcher.pm +++ b/Dispatcher.pm @@ -30,17 +30,23 @@ use NDIRC::Command; has commands => ( - is => 'rw', + is => 'ro', isa => 'HashRef[Object]', default => sub{ {} }, ); has channels => ( - is => 'rw', + is => 'ro', isa => 'HashRef[ArrayRef[Str]]', default => sub{ {} }, ); +has targets => ( + is => 'ro', + isa => 'HashRef[Str]', + default => sub{ {} }, +); + sub load { my $self = shift; @@ -122,6 +128,11 @@ sub has_command { return 0; } +sub set_target { + my ($self,$label,$target) = @_; + $self->targets->{$label} = $target; +} + sub run_command { my ($self,$c,$command,$args) = @_;