Class: Spreadsheet::Excel::Worksheet

### Home Classes Methods

### In Files

- lib/spreadsheet/excel/worksheet.rb

### Parent

Spreadsheet::Worksheet

### Methods

- ::new
- #add_link
- #add_note
- #column
- #date_base
- #each
- #ensure_rows_read
- #margins
- #pagesetup
- #row
- #row_updated
- #rows
- #set_row_address
- #shared_string

### Included Modules

- Spreadsheet::Excel::Offset

### Files

- LICENSE.txt
- Manifest.txt

### Class/Module Index

Quicksearch

- Spreadsheet
- Spreadsheet::Column
- Spreadsheet::Compatibility
- Spreadsheet::Datatypes
- Spreadsheet::Encodings
- Spreadsheet::Errors
- Spreadsheet::Excel
- Spreadsheet::Excel::Error
- Spreadsheet::Excel::ExcelCompatibleWorkbook
- Spreadsheet::Excel::Internals
- Spreadsheet::Excel::Internals::Biff5
- Spreadsheet::Excel::Internals::Biff8
- Spreadsheet::Excel::Offset
- Spreadsheet::Excel::Password
- Spreadsheet::Excel::Reader
- Spreadsheet::Excel::Reader::Biff5
- Spreadsheet::Excel::Rgb
- Spreadsheet::Excel::Row
- Spreadsheet::Excel::SstEntry
- Spreadsheet::Excel::Workbook
- Spreadsheet::Excel::Worksheet
- Spreadsheet::Font
- Spreadsheet::Format
- Spreadsheet::Formula
- Spreadsheet::Helpers
- Spreadsheet::Link
- Spreadsheet::Note
- Spreadsheet::NoteObject
- Spreadsheet::ParseExcel
- Spreadsheet::ParseExcel::Worksheet
- Spreadsheet::ParseExcel::Worksheet::Cell
- Spreadsheet::Row
- Spreadsheet::Workbook
- Spreadsheet::Worksheet
- Spreadsheet::Writer

No matching classes.

# Spreadsheet::Excel::Worksheet

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.

### Attributes

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

### Public Class Methods

new(opts = {}) click to toggle 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 = {}
      @notes = {}
    end

### Public Instance Methods

add_link(row, column, link) click to toggle source

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

add_note(row, column, note) click to toggle source

    # File lib/spreadsheet/excel/worksheet.rb, line 27
    def add_note row, column, note
      @notes.store [row, column], note
    end

column(idx) click to toggle source

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

date_base() click to toggle source

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

each(*args) click to toggle source

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

ensure_rows_read() click to toggle source

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

margins() click to toggle source

    # File lib/spreadsheet/excel/worksheet.rb, line 37
    def margins
      ensure_rows_read
      super
    end

pagesetup() click to toggle source

    # File lib/spreadsheet/excel/worksheet.rb, line 41
    def pagesetup
      ensure_rows_read
      super
    end

row(idx) click to toggle source

    # File lib/spreadsheet/excel/worksheet.rb, line 55
    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

row_updated(idx, row) click to toggle source

    # File lib/spreadsheet/excel/worksheet.rb, line 73
    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

rows() click to toggle source

    # File lib/spreadsheet/excel/worksheet.rb, line 70
    def rows
      self.to_a
    end

set_row_address(idx, opts) click to toggle source

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

shared_string(idx) click to toggle source

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.