diff options
| author | Randy Morgan <[email protected]> | 2012-03-01 04:42:20 -0800 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-03-01 04:42:20 -0800 |
| commit | d4d72ffc179b4ce7d8694acd1f0a1ac6337e14d6 (patch) | |
| tree | f0857c223464144cc2680ccd93c36f1e3aa558b0 /lib | |
| parent | 8861dd32d072bf42181d99c30ba406b07cd1e990 (diff) | |
| parent | ce4fd4066fa06b57aa645219a71c703e35d4d408 (diff) | |
| download | caxlsx-d4d72ffc179b4ce7d8694acd1f0a1ac6337e14d6.tar.gz caxlsx-d4d72ffc179b4ce7d8694acd1f0a1ac6337e14d6.zip | |
Merge pull request #39 from jurriaan/small-fixes
Small (but great!) fixes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/worksheet.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index cd0c6c97..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] @@ -234,6 +235,8 @@ module Axlsx yield @rows.last if block_given? @rows.last end + + alias :<< :add_row # Set the style for cells in a specific row # @param [Integer] index or range of indexes in the table |
