Class: Spreadsheet::Excel::Row

### Home Classes Methods

### In Files

- lib/spreadsheet/excel/row.rb

### Parent

Spreadsheet::Row

### Methods

- #[]
- #date
- #datetime
- #each
- #to_a

### 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::Row

Excel-specific Row methods

### Constants

LEAP_ERROR

  The Excel date calculation erroneously assumes that 1900 is a leap-year. All Dates after 28.2.1900 are off by one.

### Public Instance Methods

[](idx, len=nil) click to toggle source

Access data in this Row like you would in an Array. If a cell is formatted as a Date or DateTime, the decoded Date or DateTime value is returned.

    # File lib/spreadsheet/excel/row.rb, line 31
    def [] idx, len=nil
      if len
        idx = idx...(idx+len)
      end
      if idx.is_a? Range
        data = []
        idx.each do |i|
          data.push enriched_data(i, at(i))
        end
        data
      else
        enriched_data idx, at(idx)
      end
    end

date(idx) click to toggle source

Force convert the cell at idx to a Date

    # File lib/spreadsheet/excel/row.rb, line 15
    def date idx
      _date at(idx)
    end

datetime(idx) click to toggle source

Force convert the cell at idx to a DateTime

    # File lib/spreadsheet/excel/row.rb, line 20
    def datetime idx
      _datetime at(idx)
    end

each() click to toggle source

    # File lib/spreadsheet/excel/row.rb, line 23
    def each
      size.times do |idx|
        yield self[idx]
      end
    end

to_a() click to toggle source

Returns data as an array. If a cell is formatted as a Date or DateTime, the decoded Date or DateTime value is returned.

    # File lib/spreadsheet/excel/row.rb, line 48
    def to_a
      self[0...length]
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.