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.

Attributes

bof[RW]
date_base[W]
ole[RW]

Public Class Methods

new(*args) click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 34
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 = Reader.new opts
  @reader.read io
end

Public Instance Methods

add_shared_string(str) click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 44
def add_shared_string str
  @sst.push str
end
add_worksheet(worksheet) click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 47
def add_worksheet worksheet
  @changes.store :boundsheets, true
  super
end
biff_version() click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 51
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 63
def date_base
  @date_base ||= DateTime.new 1899, 12, 31
end
shared_string(idx) click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 66
def shared_string idx
  @sst[idx.to_i].content
end
sst_size() click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 69
def sst_size
  @sst.size
end
uninspect_variables() click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 72
def uninspect_variables
  super.push '@sst', '@offsets', '@changes'
end
version_string() click to toggle source
# File lib/spreadsheet/excel/workbook.rb, line 75
def version_string
  client VERSION_STRINGS.fetch(@version, "Unknown"), 'UTF-8'
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.