lib/rspreadsheet/row.rb in rspreadsheet-0.4.4 vs lib/rspreadsheet/row.rb in rspreadsheet-0.4.5

- old
+ new

@@ -35,15 +35,21 @@ def initialize(aworksheet,arowi) initialize_xml_tied_array initialize_xml_tied_item(aworksheet,arowi) end - # @!group Syntactic sugar - def cells(*params); subitems(*params) end + # @!group Syntactic sugar + def cells(*params) + if params.length == 1 + subitems(Tools.convert_column_name_to_index(params[0])) + else + subitems(*params) + end + end alias :cell :cells ## @return [String or Float or Date] value of the cell - # @param coli [Integer] colum index of the cell + # @param coli [Integer ot String] colum index of the cell of colum letter # returns value of the cell at column `coli`. # # @row = @worksheet.rows(5) # with cells containing names of months # @row[1] # => "January" # @row.cells(2).value # => "February"