Class: POI::Cells
- Inherits:
-
Object
- Object
- POI::Cells
- Includes:
- Enumerable
- Defined in:
- lib/poi/workbook/cell.rb
Instance Method Summary collapse
- #[](index) ⇒ Object
- #each ⇒ Object
-
#initialize(row) ⇒ Cells
constructor
A new instance of Cells.
- #size ⇒ Object
Constructor Details
#initialize(row) ⇒ Cells
Returns a new instance of Cells.
6 7 8 9 10 |
# File 'lib/poi/workbook/cell.rb', line 6 def initialize(row) @row = row @poi_row = row.poi_row @cells = {} end |
Instance Method Details
#[](index) ⇒ Object
12 13 14 |
# File 'lib/poi/workbook/cell.rb', line 12 def [](index) @cells[index] ||= Cell.new(@poi_row.cell(index) || @poi_row.create_cell(index), @row) end |
#each ⇒ Object
20 21 22 23 |
# File 'lib/poi/workbook/cell.rb', line 20 def each it = @poi_row.cell_iterator yield Cell.new(it.next, @row) while it.has_next end |
#size ⇒ Object
16 17 18 |
# File 'lib/poi/workbook/cell.rb', line 16 def size @poi_row.physical_number_of_cells end |