Class: ChemSpider::CompoundInfo
- Inherits:
-
Object
- Object
- ChemSpider::CompoundInfo
- Defined in:
- lib/chem_spider/services/search.rb
Constant Summary collapse
- ATTRIBUTES =
{ :csid => { :selector => 'CSID', :datatype => Integer, :first_child => true, }, :inchi => { :selector => 'InChI', :datatype => String, :first_child => true, }, :inchi_key => { :selector => 'InChIKey', :datatype => String, :first_child => true, }, :smiles => { :selector => 'SMILES', :datatype => String, :first_child => true, }, }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ CompoundInfo
constructor
A new instance of CompoundInfo.
Constructor Details
#initialize(attributes = {}) ⇒ CompoundInfo
Returns a new instance of CompoundInfo.
34 35 36 37 38 |
# File 'lib/chem_spider/services/search.rb', line 34 def initialize(attributes = {}) ATTRIBUTES.keys.each do |attr_name| instance_variable_set(:"@#{attr_name}", attributes[attr_name]) end end |
Class Method Details
.__attributes__ ⇒ Object
27 28 29 |
# File 'lib/chem_spider/services/search.rb', line 27 def __attributes__ ATTRIBUTES end |