Class: Xlsxrb::StreamSheet
- Inherits:
-
Object
- Object
- Xlsxrb::StreamSheet
- Defined in:
- lib/xlsxrb.rb,
sig/generated/xlsxrb.rbs
Overview
Represents a sheet being streamed sequentially from an XLSX file.
Instance Attribute Summary collapse
- #name ⇒ Object readonly
Instance Method Summary collapse
-
#each {|row| ... } ⇒ Enumerator, void
Iterate over rows in this streaming sheet.
-
#each_row {|row| ... } ⇒ Enumerator, void
Iterate over rows in this streaming sheet.
-
#initialize(name, sheet_xml, shared_strings) ⇒ StreamSheet
constructor
: (String name, String sheet_xml, Array shared_strings) -> void.
Constructor Details
#initialize(name, sheet_xml, shared_strings) ⇒ StreamSheet
: (String name, String sheet_xml, Array shared_strings) -> void
516 517 518 519 520 |
# File 'lib/xlsxrb.rb', line 516 def initialize(name, sheet_xml, shared_strings) @name = name @sheet_xml = sheet_xml @shared_strings = shared_strings end |
Instance Attribute Details
#name ⇒ Object (readonly)
510 511 512 |
# File 'lib/xlsxrb.rb', line 510 def name @name end |
Instance Method Details
#each {|row| ... } ⇒ Enumerator, void
Iterate over rows in this streaming sheet.
: () { (Elements::Row) -> void } -> void : | () -> Enumerator[Elements::Row, void]
550 551 552 |
# File 'lib/xlsxrb.rb', line 550 def each(&) each_row(&) end |
#each_row {|row| ... } ⇒ Enumerator, void
Iterate over rows in this streaming sheet.
: () { (Elements::Row) -> void } -> void : | () -> Enumerator[Elements::Row, void]
530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/xlsxrb.rb', line 530 def each_row return enum_for(:each_row) unless block_given? Ooxml::WorksheetParser.each_row(@sheet_xml, shared_strings: @shared_strings) do |row| if row.is_a?(Elements::Row) yield row else yield Xlsxrb.send(:build_row_from_raw, row) end end end |