Class: CSVPlusPlus::Reader::CSV
- Extended by:
- T::Generic, T::Sig
- Defined in:
- lib/csv_plus_plus/reader/csv.rb
Overview
Reads a CSV file
Constant Summary collapse
- CellValue =
type_member { { fixed: ::String } }
Instance Method Summary collapse
-
#initialize(options) ⇒ CSV
constructor
Open a CSV outputter to the
output_filename
specified by theOptions
. -
#value_at(cell) ⇒ CellValue?
Get the current value at the
cell
‘s location.
Constructor Details
#initialize(options) ⇒ CSV
Open a CSV outputter to the output_filename
specified by the Options
18 19 20 21 22 23 24 25 26 |
# File 'lib/csv_plus_plus/reader/csv.rb', line 18 def initialize() super() @options = @cell_values = ::T.let( read_csv(@options.output_filename), ::T::Array[::T::Array[::T.nilable(::CSVPlusPlus::Reader::CSV::CellValue)]] ) end |
Instance Method Details
#value_at(cell) ⇒ CellValue?
Get the current value at the cell
‘s location.
34 35 36 |
# File 'lib/csv_plus_plus/reader/csv.rb', line 34 def value_at(cell) @cell_values[cell.row_index]&.[](cell.index) end |