Class Spreadsheet::Excel::Worksheet
In: lib/spreadsheet/excel/worksheet.rb
Parent: Spreadsheet::Worksheet
Column Format Row Font Enumerable Worksheet Link Workbook SstEntry Workbook Row Array String Worksheet ExcelCompatibleWorkbook Compatibility Format Worksheet Workbook DelegateClassSpreadsheet::Format Writer Formula Reader Error Encodings Biff5 Biff8 Internals Offset Biff8 Writer Excel Datatypes ParseExcel Compatibility Spreadsheet dot/f_0.png

Excel-specific Worksheet methods. These are mostly pertinent to the Excel reader, and to recording changes to the Worksheet. You should have no reason to use any of these.

Methods

Included Modules

Spreadsheet::Excel::Offset

Attributes

guts  [R] 
links  [R] 
offset  [R] 
ole  [R] 

Public Class methods

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 15
  def initialize opts = {}
    @row_addresses = nil
    super
    @offset, @ole, @reader = opts[:offset], opts[:ole], opts[:reader]
    @dimensions = nil
    @links = {}
    @guts = {}
  end

Public Instance methods

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 23
  def add_link row, column, link
    @links.store [row, column], link
  end

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 26
  def column idx
    ensure_rows_read
    super
  end

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 30
  def date_base
    @workbook.date_base
  end

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 33
  def each *args
    ensure_rows_read
    super
  end

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 37
  def ensure_rows_read
    return if @row_addresses
    @dimensions = nil
    @row_addresses = []
    @reader.read_worksheet self, @offset if @reader
  end

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 43
  def row idx
    @rows[idx] or begin
      ensure_rows_read
      if addr = @row_addresses[idx]
        row = @reader.read_row self, addr
        [:default_format, :height, :outline_level, :hidden, ].each do |key|
          row.send "unupdated_#{key}=", addr[key]
        end
        row.worksheet = self
        row
      else
        Row.new self, idx
      end
    end
  end

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 58
  def row_updated idx, row
    res = super
    @workbook.changes.store self, true
    @workbook.changes.store :boundsheets, true
    @changes.store idx, true
    @changes.store :dimensions, true
    res
  end

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 66
  def set_row_address idx, opts
    @offsets.store idx, opts[:row_block]
    @row_addresses[idx] = opts
  end

[Source]

# File lib/spreadsheet/excel/worksheet.rb, line 70
  def shared_string idx
    @workbook.shared_string idx
  end

[Validate]