Module: Chem::Type::KCFType

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

Class Method Summary collapse

Class Method Details

.detect_file(file) ⇒ Object

Returns true if extension of file is .kcf and file name starts C-number



9
10
11
# File 'lib/chem/db/types/type_kcf.rb', line 9

def self.detect_file file
  File.extname(file) == '.kcf' && /C\d+/.match(file)
end

.detect_type(type) ⇒ Object



19
20
21
# File 'lib/chem/db/types/type_kcf.rb', line 19

def self.detect_type type
  type == :kcf
end

.parse(file) ⇒ Object

Parse file as KCF



14
15
16
17
# File 'lib/chem/db/types/type_kcf.rb', line 14

def self.parse file
  require 'chem/db/kcf'
  Chem::KEGG::KCF.new(File.open(file))
end