Sha256: dfcbf9c782187edeb4418bfa2e1bb2d5f6fe09328de84c1dd0e8e030d8e38131

Contents?: true

Size: 815 Bytes

Versions: 4

Compression:

Stored size: 815 Bytes

Contents

module RooModule

  def sheets
    @engine.sheets
  end

  def selected_sheet=(sheet)
    if sheet.is_a? Integer
      @engine.default_sheet = @engine.sheets[sheet - 1]
    else
      @engine.default_sheet = sheet
    end
  end

  def first_row
    1
  end

  def last_row
    @engine.last_row
  end

  def first_column
    @engine.first_column
  end

  def last_column
    @engine.last_column
  end

  def cell(row, col, sheet=nil)
    sheet = @engine.default_sheet if sheet.nil?
    if sheet.is_a? Integer
      @engine.cell(row, col, @engine.sheets[sheet - 1])
    else
      @engine.cell(row, col, sheet)
    end
  end

  def celltype(row, col, sheet=nil)
    if sheet.is_a? Integer
      @engine.celltype(row, col, @engine.sheets[sheet - 1])
    else
      @engine.celltype(row, col, sheet)
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
simple-spreadsheet-0.5.0 lib/simple-spreadsheet/modules/roo_module.rb
simple-spreadsheet-0.4.3 lib/simple-spreadsheet/modules/roo_module.rb
simple-spreadsheet-0.4.2 lib/simple-spreadsheet/modules/roo_module.rb
simple-spreadsheet-0.4.1 lib/simple-spreadsheet/modules/roo_module.rb