class Admins::NewImportUserFromExcel < BaseImportXlsx
  UserData = Struct.new(:login, :phone, :password, :nickname)

  def read_each(&block)
    sheet.each_row_streaming(pad_cells: true, offset: 1) do |row|
      data = row.map(&method(:cell_value))[0..3]
      block.call UserData.new(*data)
    end
  end

  private 
  def cell_value(obj)
    obj&.cell_value 
  end
end