Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def xls(name: "Workbook-#{Time.current.strftime("%Y-%m-%d--%H-%M-%S")}.xlsx")
package = Axlsx::Package.new
sheet = package.workbook.add_worksheet(name: "Sheet 1")
yield sheet
package.serialize(name)
system("open", name) if RUBY_PLATFORM.match("darwin")
name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.