class Saxlsx::Sheet
Attributes
name[R]
Public Class Methods
new(name, index, file_system, workbook)
click to toggle source
# File lib/saxlsx/sheet.rb, line 7 def initialize(name, index, file_system, workbook) @name = name @index = index @file_system = file_system @workbook = workbook end
Public Instance Methods
rows()
click to toggle source
# File lib/saxlsx/sheet.rb, line 14 def rows @rows ||= RowsCollection.new(@index, @file_system, @workbook) end
to_csv(path)
click to toggle source
# File lib/saxlsx/sheet.rb, line 18 def to_csv(path) FileUtils.mkpath path unless Dir.exists? path File.open("#{path}/#{name}.csv", 'w') do |f| rows.each do |row| f.puts row.map{|c| "\"#{c}\""}.join(',') end end end