Class: CSVPlusPlus::Reader::RubyXL

Inherits:
Reader
  • Object
show all
Extended by:
T::Generic, T::Sig
Defined in:
lib/csv_plus_plus/reader/rubyxl.rb

Overview

Reads an Excel file

Constant Summary collapse

CellValue =
type_member { { fixed: ::RubyXL::Cell } }

Instance Method Summary collapse

Constructor Details

#initialize(options, worksheet) ⇒ RubyXL

Open an excel outputter to the output_filename specified by the Options

Parameters:

  • options (Options)

    The supplied options.

  • worksheet (RubyXL::Worksheet)

    The already-opened RubyXL worksheet



19
20
21
22
23
24
# File 'lib/csv_plus_plus/reader/rubyxl.rb', line 19

def initialize(options, worksheet)
  super()

  @options = options
  @worksheet = worksheet
end

Instance Method Details

#value_at(cell) ⇒ RubyXL::Cell?

Get the current value at the cell‘s position

Parameters:

Returns:

  • (RubyXL::Cell, nil)


32
33
34
# File 'lib/csv_plus_plus/reader/rubyxl.rb', line 32

def value_at(cell)
  @worksheet.sheet_data[cell.row_index]&.[](cell.index)
end