lib/rxl.rb in rxl-0.2.1 vs lib/rxl.rb in rxl-0.3.0
- old
+ new
@@ -5,13 +5,19 @@
module Rxl
def self.write_file(filepath, hash_workbook)
begin
rubyxl_workbook = Workbook.hash_workbook_to_rubyxl_workbook(hash_workbook)
+ rubyxl_workbook.write(filepath)
+ nil
rescue => e
return e
end
- rubyxl_workbook.write(filepath)
+ end
+
+ def self.write_file_as_tables(filepath, hash_tables, order, write_headers: true)
+ hash_workbook = Workbook.hashes_to_hash_workbook(hash_tables, order, write_headers: write_headers)
+ write_file(filepath, hash_workbook)
end
def self.read_file(filepath)
rubyxl_workbook = RubyXL::Parser.parse(filepath)
Workbook.rubyxl_to_hash(rubyxl_workbook)