Class: Saxlsx::RowsCollection
- Inherits:
-
Object
- Object
- Saxlsx::RowsCollection
- Includes:
- Enumerable
- Defined in:
- lib/saxlsx/rows_collection.rb
Instance Method Summary collapse
- #[](value) ⇒ Object
- #count ⇒ Object (also: #size)
- #each(&block) ⇒ Object
-
#initialize(index, file_system, workbook) ⇒ RowsCollection
constructor
A new instance of RowsCollection.
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 |
#count ⇒ Object 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 |