class Oxcelix::RuValueWorkbook

RuValueWorkbook is a Workbook that contains the “rubyfied” values of the original Excel cells instead of Cell objects (e.g. DateTime objects). The values are taken from the Sheet arrays by running the Cell::to_ru method. The result will be exactly the same as if you ran the Sheet::to_ru method, but it will be snappier as the merged cellgroups will not need to be processed.

Private Instance Methods

buildsheet(sheet, options) click to toggle source

{include:Workbook}

# File lib/oxcelix/workbook.rb, line 358
def buildsheet(sheet, options)
  ydiff, xdiff = 0,0
  if !options[:paginate].nil?
    ydiff = options[:paginate][0] * (options[:paginate][1]-1)
  elsif !options[:cellrange].nil?
    xdiff = x(options[:cellrange].begin)
    ydiff = y(options[:cellrange].begin)
  end
  m = Sheet.build(sheet[:cells].last.y+1-ydiff, sheet[:cells].last.x+1-xdiff) {nil}
  sheet[:cells].each do |c|
    m[c.y-ydiff, c.x-xdiff] = c.to_ru
  end
  return m
end