Module: Phobius::Parser

Included in:
ParserShort
Defined in:
lib/transmembrane/phobius.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(parser_type = :short) ⇒ Object



58
59
60
61
62
63
64
65
66
67
# File 'lib/transmembrane/phobius.rb', line 58

def self.new(parser_type=:short)
  klass = 
    case parser_type
    when :short
      Phobius::ParserShort
    else
      raise ArgumentError, "don't recognize parser type: #{parser_type}"
    end
  klass.new
end

Instance Method Details

#file_to_index(file, index = {}) ⇒ Object



69
70
71
# File 'lib/transmembrane/phobius.rb', line 69

def file_to_index(file, index={})
  File.open(file) {|fh| to_index(fh, index) }
end