Module: Chem::Type::MdlMolType

Defined in:
lib/chem/db/types/type_mdl.rb

Class Method Summary collapse

Class Method Details

.detect_file(file) ⇒ Object


7
8
9
# File 'lib/chem/db/types/type_mdl.rb', line 7

def self.detect_file file
  File.extname(file) == '.mol'
end

.detect_type(type) ⇒ Object


18
19
20
# File 'lib/chem/db/types/type_mdl.rb', line 18

def self.detect_type type
  type == :mdl
end

.parse(file) ⇒ Object


11
12
13
14
15
16
# File 'lib/chem/db/types/type_mdl.rb', line 11

def self.parse file
  # autloaded
  require 'chem/db/mdl.rb'
  mol = Chem::MDL::MdlMolecule.new
  mol.open file
end

.save(mol, filename, params = {}) ⇒ Object


22
23
24
25
# File 'lib/chem/db/types/type_mdl.rb', line 22

def self.save mol, filename, params = {}
  require 'chem/db/mdl.rb'
  mol.save_as_mdl(filename)
end