Class: PubChemAPI::TaxonomySummary
- Inherits:
-
APIResponse
- Object
- APIResponse
- PubChemAPI::TaxonomySummary
- Defined in:
- lib/pubchem_api.rb
Instance Attribute Summary collapse
-
#common_name ⇒ Object
readonly
Returns the value of attribute common_name.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#scientific_name ⇒ Object
readonly
Returns the value of attribute scientific_name.
-
#synonyms ⇒ Object
readonly
Returns the value of attribute synonyms.
-
#taxonomy_id ⇒ Object
readonly
Returns the value of attribute taxonomy_id.
Instance Method Summary collapse
-
#initialize(data) ⇒ TaxonomySummary
constructor
A new instance of TaxonomySummary.
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_name ⇒ Object (readonly)
Returns the value of attribute common_name.
89 90 91 |
# File 'lib/pubchem_api.rb', line 89 def common_name @common_name end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank.
89 90 91 |
# File 'lib/pubchem_api.rb', line 89 def rank @rank end |
#scientific_name ⇒ Object (readonly)
Returns the value of attribute scientific_name.
89 90 91 |
# File 'lib/pubchem_api.rb', line 89 def scientific_name @scientific_name end |
#synonyms ⇒ Object (readonly)
Returns the value of attribute synonyms.
89 90 91 |
# File 'lib/pubchem_api.rb', line 89 def synonyms @synonyms end |
#taxonomy_id ⇒ Object (readonly)
Returns the value of attribute taxonomy_id.
89 90 91 |
# File 'lib/pubchem_api.rb', line 89 def taxonomy_id @taxonomy_id end |