class Oxcelix::Cellrange

A class that is inherited from the Xlsheet parser, but only parses a given range of the given sheet. Its initialize will accept a range parameter. Cells outside this range will not be parsed at all. Mergegroups will only be included if the starting cell is within the selected range.

Attributes

cell[RW]
cellarray[RW]
mergedcells[RW]
xmlstack[RW]

Public Class Methods

new(range) click to toggle source
Calls superclass method Oxcelix::Xlsheet::new
# File lib/oxcelix/sax/xlsheet.rb, line 116
def initialize(range)
  @cell        = Cell.new
  @RANGE_START = range.begin
  @RANGE_END   = range.end
  super()
end

Public Instance Methods

text(str) click to toggle source
# File lib/oxcelix/sax/xlsheet.rb, line 123
def text(str)
  if @xmlstack.last == :c
    if @cell.type != "shared" && @cell.type != "e" && str.numeric?
      if (((@cell.x(@RANGE_START)..@cell.x(@RANGE_END)).include? @cell.x) && ((@cell.y(@RANGE_START)..@cell.y(@RANGE_END)).include? @cell.y))
        @cell.v str
        @cellarray << @cell
      end
    end
    @cell = Cell.new
  end
end