Class: Saxlsx::RowsCollection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/saxlsx/rows_collection.rb

Instance Method Summary collapse

Constructor Details

#initialize(index, file_system, workbook) ⇒ RowsCollection

Returns a new instance of RowsCollection.



7
8
9
10
11
12
# File 'lib/saxlsx/rows_collection.rb', line 7

def initialize(index, file_system, workbook)
  @index = index
  @file_system = file_system
  @workbook = workbook
  @sheet = file_system.sheet(index)
end

Instance Method Details

#[](value) ⇒ Object



24
25
26
# File 'lib/saxlsx/rows_collection.rb', line 24

def [](value)
  to_a[value]
end

#countObject Also known as: size



18
19
20
# File 'lib/saxlsx/rows_collection.rb', line 18

def count
  @count ||= RowsCollectionCountParser.count @sheet
end

#each(&block) ⇒ Object



14
15
16
# File 'lib/saxlsx/rows_collection.rb', line 14

def each(&block)
  RowsCollectionParser.parse @index, @sheet, @workbook, &block
end