Sha256: 84e9b1ca8f57ae588adea58f1297adb58b0b017f8dfe8ab80899aab3d47fbeb8

Contents?: true

Size: 437 Bytes

Versions: 2

Compression:

Stored size: 437 Bytes

Contents

module Querinator
  class Importer

    def parse(path)
      @query_objects = []
      json_input     = JSON.parse(IO.read(path), opts = { :symbolize_names => TRUE })
      json_input.each do |json_question|
        @query_objects << Query.new(:question => json_question[:question], :answer => json_question[:answer])
      end
      @query_objects
    end

    def question_pool
      @query_objects
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
querinator-0.0.2 lib/querinator/importer.rb
querinator-0.0.1 lib/querinator/importer.rb