Class: PubChemAPI::SubstanceRecord
- Inherits:
-
APIResponse
- Object
- APIResponse
- PubChemAPI::SubstanceRecord
- Defined in:
- lib/pubchem_api.rb
Instance Attribute Summary collapse
-
#sid ⇒ Object
readonly
Returns the value of attribute sid.
-
#source_name ⇒ Object
readonly
Returns the value of attribute source_name.
-
#synonyms ⇒ Object
readonly
Returns the value of attribute synonyms.
Instance Method Summary collapse
-
#initialize(data) ⇒ SubstanceRecord
constructor
A new instance of SubstanceRecord.
Constructor Details
#initialize(data) ⇒ SubstanceRecord
Returns a new instance of SubstanceRecord.
51 52 53 54 55 56 57 |
# File 'lib/pubchem_api.rb', line 51 def initialize(data) super(data) substance = data['PC_Substances'].first @sid = substance['sid']['id'] @synonyms = substance['synonyms'] @source_name = substance['source']['db']['name'] end |
Instance Attribute Details
#sid ⇒ Object (readonly)
Returns the value of attribute sid.
49 50 51 |
# File 'lib/pubchem_api.rb', line 49 def sid @sid end |
#source_name ⇒ Object (readonly)
Returns the value of attribute source_name.
49 50 51 |
# File 'lib/pubchem_api.rb', line 49 def source_name @source_name end |
#synonyms ⇒ Object (readonly)
Returns the value of attribute synonyms.
49 50 51 |
# File 'lib/pubchem_api.rb', line 49 def synonyms @synonyms end |