class ExcelUtils::Workbooks::CSV

Constants

SHEET_NAME

Attributes

filename[R]
normalize_column_names[R]
sheet[R]

Public Class Methods

new(filename, normalize_column_names: false) click to toggle source
# File lib/excel_utils/workbooks/csv.rb, line 9
def initialize(filename, normalize_column_names: false)
  @filename = filename
  @normalize_column_names = normalize_column_names

  @sheet = Sheets::CSV.new name: SHEET_NAME,
                           normalize_column_names: normalize_column_names,
                           filename: filename
end

Public Instance Methods

[](sheet_name) click to toggle source
# File lib/excel_utils/workbooks/csv.rb, line 22
def [](sheet_name)
  sheet_name == SHEET_NAME ? sheet : nil
end
sheets() click to toggle source
# File lib/excel_utils/workbooks/csv.rb, line 18
def sheets
  [sheet]
end
to_h() click to toggle source
# File lib/excel_utils/workbooks/csv.rb, line 26
def to_h
  {SHEET_NAME => sheet.to_a}
end