Class: CDK::MolfileReader
- Inherits:
-
Object
- Object
- CDK::MolfileReader
- Defined in:
- lib/cdk/lang.rb
Overview
String-based molfile reader.
Instance Method Summary collapse
-
#initialize ⇒ MolfileReader
constructor
A new instance of MolfileReader.
-
#read(molfile) ⇒ Object
Returns the molecule encoded by the given molfile.
Constructor Details
#initialize ⇒ MolfileReader
Returns a new instance of MolfileReader.
27 28 29 |
# File 'lib/cdk/lang.rb', line 27 def initialize @reader = MDLReader.new end |
Instance Method Details
#read(molfile) ⇒ Object
Returns the molecule encoded by the given molfile.
call-seq:
MolfileReader.read(molfile) => org.openscience.cdk.Molecule
36 37 38 39 |
# File 'lib/cdk/lang.rb', line 36 def read molfile @reader.set_reader StringReader.new(molfile) @reader.read Molecule.new end |