Commits

Anonymous committed 39e1f32

Refactoring: extract a method - _output_next_fortune_delim.

This is as a stepping stone to abstracting the $nodes_list->shift / ->size() loops.

  • Participants
  • Parent commits ed7aa51

Comments (0)

Files changed (1)

XML-Grammar-Fortune/module/lib/XML/Grammar/Fortune/ToText.pm

     return;
 }
 
+sub _output_next_fortune_delim
+{
+    my $self = shift;
+
+    return $self->_out("%\n");
+}
+
 =head2 $self->run()
 
 Runs the processor. If $mode is "validate", validates the document.
         # If there are more fortunes - output a separator.
         if ($self->_fortunes_list->size())
         {
-            $self->_out("%\n");
+            $self->_output_next_fortune_delim;
         }
     }
 
 
     my $portions_list = $body_node->findnodes("description|saying");
 
-    
     while (my $portion = $portions_list->shift())
     {
         if ($portion->localname() eq "description")