Sha256: d9eb610e827a9984acaaaa75a31f122f27708bfb20f3b636ba3ed235311f94a3

Contents?: true

Size: 590 Bytes

Versions: 7

Compression:

Stored size: 590 Bytes

Contents

module HQMF
  class Parser
    
    HQMF_VERSION_1 = "1.0"
    HQMF_VERSION_2 = "2.0"
    
    def self.parse(hqmf_contents, version, codes = nil)
      
      
      case version
        when HQMF_VERSION_1
          puts("\tCodes not passed in, cannot backfill properties like gender") unless codes
          HQMF::DocumentConverter.convert(HQMF1::Document.new(hqmf_contents).to_json, codes)
        when HQMF_VERSION_2
          HQMF2::Document.new(hqmf_contents).to_model
        else
          raise "Unsupported HQMF version specified: #{version}"
        end
      end
    
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hqmf-parser-1.0.6 lib/hqmf-parser/parser.rb
hqmf-parser-1.0.5 lib/hqmf-parser/parser.rb
hqmf-parser-1.0.4 lib/hqmf-parser/parser.rb
hqmf-parser-1.0.3 lib/hqmf-parser/parser.rb
hqmf-parser-1.0.2 lib/hqmf-parser/parser.rb
hqmf-parser-1.0.1 lib/hqmf-parser/parser.rb
hqmf-parser-1.0.0 lib/hqmf-parser/parser.rb