Axlsx merge_cells accepts a string, as in your example, or an array of cells.
To that extent, you can use the rows, cols and their cells collections to find, and pass in an array of cells you want to merge.
Something like:
sheet.merge_cells sheet.rows.last.cells
For reference, here's the documentation on Worksheet#merge_cell
# Creates merge information for this worksheet.
# Cells can be merged by calling the merge_cells method on a worksheet.
# @example This would merge the three cells C1..E1 #
# worksheet.merge_cells "C1:E1"
# # you can also provide an array of cells to be merged
# worksheet.merge_cells worksheet.rows.first.cells[(2..4)]
# #alternatively you can do it from a single cell
# worksheet["C1"].merge worksheet["E1"]
# @param [Array, string] cells
def merge_cells(cells)
merged_cells.add cells
end