Class: PubChemAPI::TaxonomySummary

Inherits:
APIResponse show all
Defined in:
lib/pubchem_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ TaxonomySummary

Returns a new instance of TaxonomySummary.



91
92
93
94
95
96
97
98
99
# File 'lib/pubchem_api.rb', line 91

def initialize(data)
  super(data)
  taxon = data['TaxaInfo'].first
  @taxonomy_id = taxon['TaxId']
  @scientific_name = taxon['ScientificName']
  @common_name = taxon['OtherNames']['CommonName']
  @rank = taxon['Rank']
  @synonyms = taxon['OtherNames']['Synonym']
end

Instance Attribute Details

#common_nameObject (readonly)

Returns the value of attribute common_name.



89
90
91
# File 'lib/pubchem_api.rb', line 89

def common_name
  @common_name
end

#rankObject (readonly)

Returns the value of attribute rank.



89
90
91
# File 'lib/pubchem_api.rb', line 89

def rank
  @rank
end

#scientific_nameObject (readonly)

Returns the value of attribute scientific_name.



89
90
91
# File 'lib/pubchem_api.rb', line 89

def scientific_name
  @scientific_name
end

#synonymsObject (readonly)

Returns the value of attribute synonyms.



89
90
91
# File 'lib/pubchem_api.rb', line 89

def synonyms
  @synonyms
end

#taxonomy_idObject (readonly)

Returns the value of attribute taxonomy_id.



89
90
91
# File 'lib/pubchem_api.rb', line 89

def taxonomy_id
  @taxonomy_id
end