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, line 1056
def initialize(dbname, nsclass, arg)
  @dbname = dbname
  @nsclass = nsclass
  if arg.is_a?(String) then
    a = arg.split("\t")
  else
    a = arg
  end
  a.each do |x|
    self[x] = @nsclass.new(@dbname, x)
  end
  self
end

Public Instance Methods

close()
Alias for: close_all
close_all() click to toggle source
# File lib/bio/io/flatfile/index.rb, line 1086
def close_all
  values.each { |x| x.file.close }
end
Also aliased as: close
each_files() { |x| ... } click to toggle source
# File lib/bio/io/flatfile/index.rb, line 1076
def each_files
  self.values.each do |x|
    yield x
  end
end
each_names() { |x| ... } click to toggle source
# File lib/bio/io/flatfile/index.rb, line 1070
def each_names
  self.names.each do |x|
    yield x
  end
end
names() click to toggle source
# File lib/bio/io/flatfile/index.rb, line 1082
def names
  keys
end
search_names(key, *names) click to toggle source
# File lib/bio/io/flatfile/index.rb, line 1101
def search_names(key, *names)
  r = []
  names.each do |x|
    ns = self[x]
    raise "undefined namespace #{x.inspect}" unless ns
    r.concat ns.search(key)
  end
  r
end
to_s() click to toggle source
# File lib/bio/io/flatfile/index.rb, line 1111
def to_s
  names.join("\t")
end