Module: Chem::Type::KeggReactionType

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

Class Method Summary collapse

Class Method Details

.detect_file(filename) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/chem/db/types/type_kegg.rb', line 8

def self.detect_file filename
  if File.basename(filename) == "reaction"
    File.open(filename) do |file|
      return true if /ENTRY       /.match(file.readline)
    end
  end
end

.detect_type(type) ⇒ Object



21
22
23
# File 'lib/chem/db/types/type_kegg.rb', line 21

def self.detect_type type
  type == :kegg_reaction
end

.parse(file) ⇒ Object



16
17
18
19
# File 'lib/chem/db/types/type_kegg.rb', line 16

def self.parse file
  require 'chem/db/kegg'
  Chem::KEGG::KeggReactionParser.new file
end