]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/backtrack.rb
added backtrack.rb
[biopieces.git] / code_ruby / lib / maasha / backtrack.rb
index a124895ffda7bc2ed8336ec1049fc72ddb927e20..d920d8e5c3a06b872b98b5b536174bdffda32785 100644 (file)
@@ -56,7 +56,7 @@ module BackTrack
       end
     end
 
-    matches unless block_given?
+    return matches.empty? ? nil : matches unless block_given?
   end
 
   private
@@ -149,6 +149,10 @@ module BackTrack
       @length = length
       @match  = match
     end
+
+    def to_s
+      "#{pos}:#{length}:#{match}"
+    end
   end
 end