]> git.cworth.org Git - sup/commitdiff
MBox::Loader#next determines labels with self.labels instead of @labels
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 24 Feb 2008 22:28:53 +0000 (14:28 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 24 Feb 2008 22:28:53 +0000 (14:28 -0800)
This allows subclasses to define fixed #labels methods rather than
having to set a shared instance variable (which is one of the few
features of Ruby I actively hate.) SentLoader does this,

lib/sup/mbox/loader.rb

index a66d7b906004f57b612c4888bc3111c674906547..4acc0645d90f99dd7ac5f77768a1b3e26c30e4a5 100644 (file)
@@ -147,7 +147,7 @@ class Loader < Source
     end
 
     self.cur_offset = next_offset
-    [returned_offset, (@labels + [:unread]).uniq]
+    [returned_offset, (self.labels + [:unread]).uniq]
   end
 end