class Spreadsheet::Excel::Workbook
Excel-specific Workbook
methods. These are mostly pertinent to the Excel
reader. You should have no reason to use any of these.
Constants
- BIFF_VERSIONS
- VERSION_STRINGS
Attributes
bof[RW]
date_base[W]
ole[RW]
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
Spreadsheet::Excel::Offset::new
# File lib/spreadsheet/excel/workbook.rb, line 33 def initialize *args super enc = 'UTF-16LE' if RUBY_VERSION >= '1.9' enc = Encoding.find enc end @encoding = enc @version = 0x600 @sst = [] end
open(io, opts = {})
click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 30 def Workbook.open io, opts = {} Reader.new(opts).read(io) end
Public Instance Methods
add_worksheet(name)
click to toggle source
Calls superclass method
Spreadsheet::Workbook#add_worksheet
# File lib/spreadsheet/excel.rb, line 21 def add_worksheet name if name.is_a? String create_worksheet :name => name else super end end
biff_version()
click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 50 def biff_version case @bof when 0x009 2 when 0x209 3 when 0x409 4 else BIFF_VERSIONS.fetch(@version) { raise "Unkown BIFF_VERSION '#@version'" } end end
date_base()
click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 62 def date_base @date_base ||= DateTime.new 1899, 12, 31 end
inspect()
click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 65 def inspect self.worksheets end
sst_size()
click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 71 def sst_size @sst.size end
uninspect_variables()
click to toggle source
Calls superclass method
# File lib/spreadsheet/excel/workbook.rb, line 74 def uninspect_variables super.push '@sst', '@offsets', '@changes' end
version_string()
click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 77 def version_string client VERSION_STRINGS.fetch(@version, "Unknown"), 'UTF-8' end