class Workbook
Public Class Methods
new(java_wb)
click to toggle source
# File lib/jruby_excelcom/workbook.rb, line 4 def initialize(java_wb) @wb = java_wb end
Public Instance Methods
add_worksheet(name)
click to toggle source
adds and returns a worksheet to this workbook
name
-
name of new worksheet
# File lib/jruby_excelcom/workbook.rb, line 33 def add_worksheet(name) Worksheet.new(@wb.addWorksheet(name)) end
Also aliased as: addWorksheet
close(save = false)
click to toggle source
closes this workbook
save
-
whether changes should be saved or not, default is
false
# File lib/jruby_excelcom/workbook.rb, line 16 def close(save = false) @wb.close(save) end
name()
click to toggle source
gets the name of this workbook
# File lib/jruby_excelcom/workbook.rb, line 9 def name @wb.getName end
Also aliased as: getName
save()
click to toggle source
saves this workbook
# File lib/jruby_excelcom/workbook.rb, line 21 def save @wb.save end
save_as(path)
click to toggle source
saves this workbook to a new location. Every further operations on this workbook will happen to the newly saved file.
# File lib/jruby_excelcom/workbook.rb, line 26 def save_as(path) @wb.saveAs(java.io.File.new(path)) end
Also aliased as: saveAs
worksheet(name)
click to toggle source
gets a worksheet
name
-
name of worksheet to get
# File lib/jruby_excelcom/workbook.rb, line 40 def worksheet(name) Worksheet.new(@wb.getWorksheet(name)) end
Also aliased as: getWorksheet