Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 8f591be

Converted ->{'relative'} to the Class::XSAccessor-based ->_relative().

  • Participants
  • Parent commits ba01b41

Comments (0)

Files changed (1)

File File-Find-Object-Rule/lib/File/Find/Object/Rule.pm

         "finder" => "finder",
         "_match_cb" => "_match_cb",
         "rules" => "rules",
+        "_relative" => "_relative",
         "_subs" => "_subs",
     }
     ;
         extras   => {},
         maxdepth => undef,
         mindepth => undef,
-        relative => 0,
+        _relative => 0,
     }, $class;
 }
 
 
 sub relative () {
     my $self = _force_object shift;
-    $self->{relative} = 1;
-    $self;
+    $self->_relative(1);
+
+    return $self;
 }
 
 =item C<not_*>
     my $subs = $self->_subs();
 
     warn "relative mode handed multiple paths - that's a bit silly\n"
-      if $self->{relative} && @_ > 1;
+      if $self->_relative() && @paths > 1;
 
     my $code = 'sub {
         my $path_obj = shift;
 
     my $match_cb = $self->_match_cb();
     my $preproc_cb = $self->extras()->{'preprocess'};
-    my $relative = $self->{relative};
 
     while(defined(my $next_obj = $finder->next_obj()))
     {
 
         if (defined(my $path = $match_cb->($next_obj, $next_obj->path())))
         {
-            if ($relative)
+            if ($self->_relative)
             {
                 my $comps = $next_obj->full_components();
                 if (@$comps)