lib/formulae/run/reference.rb in rubyfromexcel-0.0.18 vs lib/formulae/run/reference.rb in rubyfromexcel-0.0.19

- old
+ new

@@ -7,10 +7,10 @@ worksheet ? "#{worksheet}.#{integer_to_column(column_number)}#{row_number.to_i}" : "#{integer_to_column(column_number)}#{row_number.to_i}" end def self.column_to_integer(string) @column_to_integer_cache ||= {} - return @column_to_integer_cache[string] ||= string.downcase.each_byte.to_a.reverse.each.with_index.inject(0) do |memo,byte_with_index,c| + return @column_to_integer_cache[string] ||= string.downcase.each_byte.to_a.reverse.each.with_index.inject(0) do |memo,byte_with_index| memo = memo + ((byte_with_index.first - 96) * (26**byte_with_index.last)) end end def self.integer_to_column(integer) \ No newline at end of file