summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorJurriaan Pruis <[email protected]>2012-03-01 13:11:32 +0100
committerJurriaan Pruis <[email protected]>2012-03-01 13:11:32 +0100
commitce4fd4066fa06b57aa645219a71c703e35d4d408 (patch)
treef0857c223464144cc2680ccd93c36f1e3aa558b0 /lib
parentbb941417e85935726dc1d462165dfcc1b1f1927b (diff)
downloadcaxlsx-ce4fd4066fa06b57aa645219a71c703e35d4d408.tar.gz
caxlsx-ce4fd4066fa06b57aa645219a71c703e35d4d408.zip
Accept row numbers in Worksheet#[]
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index d1c8e6ac..68a3e3c6 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -112,9 +112,10 @@ module Axlsx
# Returns the cell or cells defined using excel style A1:B3 references.
- # @param [String] cell_def the string defining the cell or range of cells
+ # @param [String|Integer] cell_def the string defining the cell or range of cells, or the rownumber
# @return [Cell, Array]
def [](cell_def)
+ return rows[cell_def - 1] if cell_def.is_a? Integer
parts = cell_def.split(':')
first = name_to_cell parts[0]