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
202 def strings_as_hash(lines)
203   hash = {}
204   lines.each do |line|
205     entry_id, definition = line.split(/\s+/, 2)
206     hash[entry_id] = definition
207   end
208   return hash
209 end