Class: CDK::InChIWriter
- Inherits:
-
Object
- Object
- CDK::InChIWriter
- Defined in:
- lib/cdk/lang.rb
Overview
String-based InChI writer.
Instance Method Summary collapse
-
#initialize ⇒ InChIWriter
constructor
A new instance of InChIWriter.
-
#write(mol) ⇒ Object
Returns the InChI representation of the given molecule.
Constructor Details
#initialize ⇒ InChIWriter
Returns a new instance of InChIWriter.
111 112 113 114 |
# File 'lib/cdk/lang.rb', line 111 def initialize @factory = InChIGeneratorFactory.new @hydrogen_adder = HydrogenAdder.new end |
Instance Method Details
#write(mol) ⇒ Object
121 122 123 124 |
# File 'lib/cdk/lang.rb', line 121 def write mol @hydrogen_adder.add_implicit_hydrogens_to_satisfy_valency mol @factory.getInChIGenerator(mol).inchi end |