module Bio::KEGG::Common::StringsAsHash

This module provides #strings_as_hash private method.

Bio::KEGG::* internal use only.

Private Instance Methods

strings_as_hash(lines) click to toggle source

(Private) Creates a hash from lines. Each line is consisted of two components, ID and description, separated with spaces. IDs must be unique with each other.

# File lib/bio/db/kegg/common.rb, line 202
def strings_as_hash(lines)
  hash = {}
  lines.each do |line|
    entry_id, definition = line.split(/\s+/, 2)
    hash[entry_id] = definition
  end
  return hash
end