X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=blobdiff_plain;f=Dispatcher.pm;h=7c4b0a60618c10eaa56180bf1dcd9729102c38b9;hp=a96c32e164843fda69c1998d5b18abad2f89fa4f;hb=0d63bf9da52cdfe2c9d8850b690032ff539b6398;hpb=5f2c0808b406a1c97a4cf07d1c7c51d574b4a6f6 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) = @_;