Anonymous avatar Anonymous committed b72b770

Created an accessor for the targets.

Comments (0)

Files changed (1)

lib/File/Find/Object.pm

 
 __PACKAGE__->mk_accessors(qw(
     _dir_stack
+    _targets
 ));
 
 sub _get_options_ids
 our $VERSION = '0.0.4';
 
 sub new {
-    my ($class, $options, @files) = @_;
+    my ($class, $options, @targets) = @_;
 
     my $tree = {
-        files => [ @files ],
+        
         ind => -1,
         
         _dir_stack => [],
     {
         $tree->set($opt, $options->{$opt});
     }
+    $tree->_targets([ @targets ]);
 
     return $tree;
 }
 {
     my $self = shift;
 
-    $self->{ind} > @{$self->{files}} and return;
+    $self->{ind} > @{$self->_targets()} and return;
     $self->{ind}++;
-    $self->_curr_file(${$self->{files}}[$self->{ind}]);
+    $self->_curr_file($self->_targets()->[$self->{ind}]);
     $self->_action({});
     1;
 }
 
 =head2 new
 
-    my $ffo = File::Find::Object->new( { options }, @files);
+    my $ffo = File::Find::Object->new( { options }, @targets);
 
-Create a new File::Find::Object object. @files is the list of directories
-- or files - the object should explore.
+Create a new File::Find::Object object. C<@targets> is the list of 
+directories or files which the object should explore.
 
 =head3 options
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.