Module: Adiwg_TaxonCl

Defined in:
lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_taxonClass.rb

Overview

History: Stan Smith 2013-11-21 original script

Class Method Summary collapse

Class Method Details

.unpack(hTaxClass) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_taxonClass.rb', line 9

def self.unpack(hTaxClass)

  # instance classes needed in script
  intMetadataClass = .new

  intTaxClass = intMetadataClass.newTaxonClass

  # taxonomic classification - common name
  if hTaxClass.has_key?('common')
    s = hTaxClass['common']
    if s != ''
      intTaxClass[:commonName] = s
    end
  end

  # taxonomic classification - rank
  if hTaxClass.has_key?('taxonRank')
    s = hTaxClass['taxonRank']
    if s != ''
      intTaxClass[:taxRankName] = s
    end
  end

  # taxonomic classification - value
  if hTaxClass.has_key?('taxonValue')
    s = hTaxClass['taxonValue']
    if s != ''
      intTaxClass[:taxRankValue] = s
    end
  end

  return intTaxClass
end