Sha256: 1cb2e38b0dea368ba85d829f2d78120c04d5828a4203c8852fe506df4ae37834

Contents?: true

Size: 629 Bytes

Versions: 10

Compression:

Stored size: 629 Bytes

Contents

require 'roo'

module QME
  module Measure
  
    # Utility class for converting NQF XLS files to JSON
    class Converter
    
      #Convert an NQF XLS file to a hash
      def self.from_xls(file)
        xls =Excelx.new(file)
        xls.default_sheet='Measure_QDS'
        result = {}
        (xls.header_line+1..xls.last_row).each do |row|
          entry = {}
          (xls.first_column..xls.last_column).each do |column|
            entry[xls.cell(xls.header_line, column)] = xls.cell(row, column)
          end
          result[entry['QDS_id']] = entry
        end
        result
      end
      
    end
    
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
quality-measure-engine-1.1.5 lib/qme/measure/properties_converter.rb
quality-measure-engine-1.1.3 lib/qme/measure/properties_converter.rb
quality-measure-engine-1.1.2 lib/qme/measure/properties_converter.rb
quality-measure-engine-1.1.1 lib/qme/measure/properties_converter.rb
quality-measure-engine-1.1.0 lib/qme/measure/properties_converter.rb
quality-measure-engine-1.0.4 lib/qme/measure/properties_converter.rb
quality-measure-engine-1.0.3 lib/qme/measure/properties_converter.rb
quality-measure-engine-1.0.2 lib/qme/measure/properties_converter.rb
quality-measure-engine-1.0.1 lib/qme/measure/properties_converter.rb
quality-measure-engine-0.8.0 lib/qme/measure/properties_converter.rb