Class: Xlsxrb::StreamSheet

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

Overview

Represents a sheet being streamed sequentially.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, sheet_xml, shared_strings) ⇒ StreamSheet

Returns a new instance of StreamSheet.



432
433
434
435
436
# File 'lib/xlsxrb.rb', line 432

def initialize(name, sheet_xml, shared_strings)
  @name = name
  @sheet_xml = sheet_xml
  @shared_strings = shared_strings
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



430
431
432
# File 'lib/xlsxrb.rb', line 430

def name
  @name
end

Instance Method Details

#each_rowObject Also known as: each



438
439
440
441
442
443
444
# File 'lib/xlsxrb.rb', line 438

def each_row
  return enum_for(:each_row) unless block_given?

  Ooxml::WorksheetParser.each_row(@sheet_xml, shared_strings: @shared_strings) do |raw_row|
    yield Xlsxrb.send(:build_row_from_raw, raw_row)
  end
end