X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTask.pm;h=7e4d3fbcc2e038ba849c4864c50eaa0582d6958a;hp=e39e18400188c85e738d28f4cd2ad67782a27497;hb=512aa2caede0fcaa7f7700569a337bd65be48cb8;hpb=0ccf62ac59a4ce292d6296abde96af8abff121c0 diff --git a/lib/ZOOM/IRSpy/Task.pm b/lib/ZOOM/IRSpy/Task.pm index e39e184..7e4d3fb 100644 --- a/lib/ZOOM/IRSpy/Task.pm +++ b/lib/ZOOM/IRSpy/Task.pm @@ -1,4 +1,4 @@ -# $Id: Task.pm,v 1.2 2006-10-12 14:36:34 mike Exp $ +# $Id: Task.pm,v 1.3 2006-10-25 10:52:53 mike Exp $ package ZOOM::IRSpy::Task; @@ -32,13 +32,14 @@ pointer to the next task to be performed after this. sub new { my $class = shift(); - my($conn, $udata, %cb) = @_; + my($conn, $udata, $options, %cb) = @_; return bless { irspy => $conn->{irspy}, conn => $conn, - cb => \%cb, udata => $udata, + options => $options, + cb => \%cb, timeRegistered => time(), }, $class; } @@ -64,6 +65,17 @@ sub run { die "can't run base-class task $this"; } +sub set_options { + my $this = shift(); + + my %options = %{ $this->{options} }; + foreach my $key (sort keys %options) { + my $value = $options{$key}; + $this->conn()->log("irspy_debug", "$this setting option '$key' -> '$value'"); + $this->conn()->option($key, $value); + } +} + sub render { my $this = shift(); return "[base-class] " . ref($this);