]> ruin.nu Git - NDIRC.git/blobdiff - Dispatcher.pm
Removed the global variables for special chans, using targets hashref in Dispatcher...
[NDIRC.git] / Dispatcher.pm
index a96c32e164843fda69c1998d5b18abad2f89fa4f..7c4b0a60618c10eaa56180bf1dcd9729102c38b9 100644 (file)
@@ -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) = @_;