Commits

shl...@6f433eb9-a002-0410-945b-ee5462c261ee  committed 15e398e

Moved all common accessors into a common base class, and added the inode()
accessor.

  • Participants
  • Parent commits 4fce59e

Comments (0)

Files changed (1)

File lib/File/Find/Object.pm

 # This program is free software, distributed under the same terms as 
 # Parrot.
 
-package File::Find::Object::PathComponent;
+package File::Find::Object::Base;
 
 use strict;
 use warnings;
 
 use base 'Class::Accessor';
 
-use File::Spec;
-
 __PACKAGE__->mk_accessors(qw(
     _action
     _curr_file
     dir
+    _files
     idx
-    _files
-    )
-);
+    inode
+));
+
+package File::Find::Object::PathComponent;
+
+use strict;
+use warnings;
+
+use vars qw(@ISA);
+
+@ISA = (qw(File::Find::Object::Base));
+
+use File::Spec;
+
 
 sub new {
     my ($class, $top, $from, $index) = @_;
 use strict;
 use warnings;
 
-use base 'Class::Accessor';
+use vars qw(@ISA);
+
+@ISA = (qw(File::Find::Object::Base));
 
 __PACKAGE__->mk_accessors(qw(
-    _action
     _dir_stack
-    dir
-    idx
-    _curr_file
-    _files
 ));
 
 use Carp;
     }
     my $ptr = $current; my $rc;
     while($self->_father($ptr)) {
-        if($self->_father($ptr)->{inode} == $st[1] && $self->_father($ptr) == $st[0]) {
+        if($self->_father($ptr)->inode() == $st[1] && $self->_father($ptr) == $st[0]) {
             $rc = 1;
             last;
         }
     );
     closedir($handle);
     my @st = stat($current->dir());
-    $current->{inode} = $st[1];
+    $current->inode($st[1]);
     $current->{dev} = $st[0];
     return 1;
 }