ToWorksheet

Generate a worksheet from an array.

Installation

gem install to_worksheet

Example


  my_array = [['apple', 1], ['orange', 0.5], ['pineapple', 2], ['watermelon', 3]]
  worksheet = my_array.to_worksheet(:header => ['fruit', 'price'], :name => 'Price List')
  file  = File.new("/tmp/worksheet.xls", "w")
  file.puts worksheet
  file.close

Maintainers

How to collaborate

If you would collaborate, you can create a fork, apply the modification and submit a pull request :)