From: Mike Taylor Date: Wed, 21 Jun 2006 14:35:03 +0000 (+0000) Subject: Expose Pod object and per-target records to Test modules. X-Git-Tag: CPAN-v1.02~54^2~1155 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=743ea7f5fb483bb6d7bd519121730d05e6d25a48 Expose Pod object and per-target records to Test modules. --- diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index 7ed3046..973c68a 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.3 2006-06-20 16:32:03 mike Exp $ +# $Id: IRSpy.pm,v 1.4 2006-06-21 14:35:03 mike Exp $ package ZOOM::IRSpy; @@ -41,7 +41,10 @@ sub new { my $this = bless { conn => $conn, allrecords => 1, # unless overridden by targets() - # query and targets will be filled in later + query => undef, # filled in later + targets => undef, # filled in later + target2record => undef, # filled in later + pod => undef, # filled in later }, $class; $this->log("irspy", "starting up with database '$dbname'"); @@ -144,7 +147,10 @@ sub initialise { } } + $this->{target2record} = \%target2record; $this->{pod} = new ZOOM::Pod(@{ $this->{targets} }); + delete $this->{targets}; # The information is now in the Pod. + delete $this->{query}; # Not needed at all } @@ -191,6 +197,20 @@ sub _run_test { } +# Access methods for the use of Test modules +sub pod { + my $this = shift(); + return $this->{pod}; +} + +sub record { + my $this = shift(); + my($target) = @_; + return $this->{target2record}->{$target}; +} + + + =head1 SEE ALSO ZOOM::IRSpy::Record