Class: Xlsxrb::StreamSheet

Inherits:
Object
  • Object
show all
Defined in:
lib/xlsxrb.rb,
sig/generated/xlsxrb.rbs

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.

Parameters:

  • name (Object)
  • sheet_xml (Object)
  • shared_strings (Object)


485
486
487
488
489
# File 'lib/xlsxrb.rb', line 485

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.

Returns:

  • (Object)


483
484
485
# File 'lib/xlsxrb.rb', line 483

def name
  @name
end

Instance Method Details

#each {|arg0| ... } ⇒ void

This method returns an undefined value.

: () { (Elements::Row) -> void } -> void : | () -> Enumerator[Elements::Row, void]

Yields:

Yield Parameters:

Yield Returns:

  • (void)


507
508
509
# File 'lib/xlsxrb.rb', line 507

def each(&)
  each_row(&)
end

#each_row {|arg0| ... } ⇒ void

This method returns an undefined value.

: () { (Elements::Row) -> void } -> void : | () -> Enumerator[Elements::Row, void]

Yields:

Yield Parameters:

Yield Returns:

  • (void)


493
494
495
496
497
498
499
500
501
502
503
# File 'lib/xlsxrb.rb', line 493

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