class Spread2RDF::RooAdapter
Public Class Methods
new()
click to toggle source
# File lib/spread2rdf/roo_helper.rb, line 6 def initialize end
Public Instance Methods
cell(coord, worksheet = nil)
click to toggle source
# File lib/spread2rdf/roo_helper.rb, line 32 def cell(coord, worksheet = nil) coord = Coord[coord] unless coord.is_a? Coord #if worksheet @roo.cell(coord.column, coord.row, worksheet) #else # @roo.cell(coord.column, coord.row) #end end
load(file)
click to toggle source
TODO: make this work with other spreadsheets than Excel
# File lib/spread2rdf/roo_helper.rb, line 11 def load(file) options = {} options[:packed], options[:file_warning] = :zip, :ignore if File.extname(file).downcase == '.xlsm' @roo = Roo::Excelx.new(file, options) end
roo(worksheet = nil) { |roo| ... }
click to toggle source
# File lib/spread2rdf/roo_helper.rb, line 22 def roo(worksheet = nil) return @roo if worksheet.nil? last_default_sheet = @roo.default_sheet select_worksheet(worksheet) return @roo unless block_given? result = yield @roo @roo.default_sheet = last_default_sheet result end
select_worksheet(worksheet)
click to toggle source
# File lib/spread2rdf/roo_helper.rb, line 18 def select_worksheet(worksheet) @roo.default_sheet = worksheet end