Class: Spreadshoot::Row
- Inherits:
-
Object
- Object
- Spreadshoot::Row
- Defined in:
- lib/spreadshoot.rb
Overview
A row of a table. The table could be horizontal oriented, or vertical oriented.
Instance Method Summary collapse
-
#cell(value = nil, options = {}) ⇒ Object
Creates a cell within a row.
-
#initialize(table, options = {}) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(table, options = {}) ⇒ Row
Note:
Do not call directly, rows should be created using Table#row or #Worksheet#row methods
Returns a new instance of Row.
490 491 492 493 |
# File 'lib/spreadshoot.rb', line 490 def initialize table, = {} @table = table @options = end |
Instance Method Details
#cell(value = nil, options = {}) ⇒ Object
Creates a cell within a row.
501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/spreadshoot.rb', line 501 def cell value = nil, = {} cell = Cell.new(@table, value, @options.merge()) @table.worksheet.cells[@table.current_row] ||= {} @table.worksheet.cells[@table.current_row][@table.current_col] = cell if @table.direction == :vertical @table.col_index += 1 else @table.row_index += 1 end cell end |