def to_xls
      book = Spreadsheet::Workbook.new
      sheet = book.create_worksheet

      rows! do |columns, model, x|
        sheet.row(x).concat(columns)
      end

      spreadsheet = StringIO.new
      book.write(spreadsheet)
      spreadsheet.string
    end
def to_xls
      book = Spreadsheet::Workbook.new
      sheet = book.create_worksheet

      rows! do |columns, model, x|
        sheet.row(x).concat(columns)
      end

      spreadsheet = StringIO.new
      book.write(spreadsheet)
      spreadsheet.string
    end
舊版 Excel