class Bio::FlatFileIndex::NameSpaces

namespaces

Internal use only.

Public Class Methods

new(dbname, nsclass, arg) click to toggle source
     # File lib/bio/io/flatfile/index.rb
1056 def initialize(dbname, nsclass, arg)
1057   @dbname = dbname
1058   @nsclass = nsclass
1059   if arg.is_a?(String) then
1060     a = arg.split("\t")
1061   else
1062     a = arg
1063   end
1064   a.each do |x|
1065     self[x] = @nsclass.new(@dbname, x)
1066   end
1067   self
1068 end

Public Instance Methods

close()
Alias for: close_all
close_all() click to toggle source
     # File lib/bio/io/flatfile/index.rb
1086 def close_all
1087   values.each { |x| x.file.close }
1088 end
Also aliased as: close
each_files() { |x| ... } click to toggle source
     # File lib/bio/io/flatfile/index.rb
1076 def each_files
1077   self.values.each do |x|
1078     yield x
1079   end
1080 end
each_names() { |x| ... } click to toggle source
     # File lib/bio/io/flatfile/index.rb
1070 def each_names
1071   self.names.each do |x|
1072     yield x
1073   end
1074 end
names() click to toggle source
     # File lib/bio/io/flatfile/index.rb
1082 def names
1083   keys
1084 end
search_names(key, *names) click to toggle source
     # File lib/bio/io/flatfile/index.rb
1101 def search_names(key, *names)
1102   r = []
1103   names.each do |x|
1104     ns = self[x]
1105     raise "undefined namespace #{x.inspect}" unless ns
1106     r.concat ns.search(key)
1107   end
1108   r
1109 end
to_s() click to toggle source
     # File lib/bio/io/flatfile/index.rb
1111 def to_s
1112   names.join("\t")
1113 end