lib/bamfcsv/table.rb in bamfcsv-0.1.1 vs lib/bamfcsv/table.rb in bamfcsv-0.1.2

- old
+ new

@@ -10,12 +10,15 @@ end @row_cache = [] end def each - @matrix.size.times do |idx| - yield self[idx] + if block_given? + @matrix.size.times do |idx| + yield self[idx] + end end + self end def [](idx) idx += @matrix.size if idx < 0 return if idx < 0 || idx >= @matrix.size