class ExcelUtils::Sheets::Excel

Attributes

spreadsheet[R]

Public Class Methods

new(spreadsheet:, **options) click to toggle source
Calls superclass method ExcelUtils::Sheets::Base::new
# File lib/excel_utils/sheets/excel.rb, line 5
def initialize(spreadsheet:, **options)
  super(**options)
  @spreadsheet = spreadsheet
end

Private Instance Methods

each_row() { |row| ... } click to toggle source
# File lib/excel_utils/sheets/excel.rb, line 20
def each_row
  with_sheet do |sheet|
    (sheet.first_row + 1).upto(sheet.last_row) do |i|
      yield sheet.row(i)
    end
  end
end
first_row() click to toggle source
# File lib/excel_utils/sheets/excel.rb, line 14
def first_row
  with_sheet do |sheet|
    sheet.first_row ? sheet.row(sheet.first_row) : []
  end
end
with_sheet() { |sheet| ... } click to toggle source
# File lib/excel_utils/sheets/excel.rb, line 28
def with_sheet
  yield spreadsheet.sheet(name)
end