I think this should be `next l` instead of `return l`.  `return` will return from the method, not just the inject loop.

Another approach might be to `e.note.to_s.rstrip.length` instead of checking for `nil`.  That might be more readable.