Class: Chem::PubChem::PubChemEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/chem/db/pubchem.rb

Instance Method Summary collapse

Constructor Details

#initialize(cid) ⇒ PubChemEntry

Returns a new instance of PubChemEntry.



83
84
85
# File 'lib/chem/db/pubchem.rb', line 83

def initialize cid
  @cid = cid
end

Instance Method Details

#get_sdfObject



92
93
94
95
# File 'lib/chem/db/pubchem.rb', line 92

def get_sdf
  Net::HTTP.version_1_2
  Net::HTTP.get(Host, Summary + "\?disopt=DisplaySDF&cid=%d" % @cid)
end

#get_xmlObject



87
88
89
90
# File 'lib/chem/db/pubchem.rb', line 87

def get_xml
  Net::HTTP.version_1_2
  Net::HTTP.get(Host, Summary + "\?disopt=DisplayXML&cid=%dd" % @cid)
end