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.