class Bio::FlatFileIndex::Flat_1::Record

Record class.

Internal use only.

Attributes

key[R]
size[R]
val[R]

Public Class Methods

create(size, key, val) click to toggle source
# File lib/bio/io/flatfile/index.rb, line 714
def self.create(size, key, val)
  self.new(self.to_string(size, key, val))
end
new(str, size = nil) click to toggle source
# File lib/bio/io/flatfile/index.rb, line 696
def initialize(str, size = nil)
  a = str.split("\t")
  a.each { |x| x.to_s.gsub!(/[\000 ]+\z/, '') }
  @key = a.shift.to_s
  @val = a
  @size = (size or str.length)
  #DEBUG.print "key=#{@key.inspect},val=#{@val.inspect},size=#{@size}\n"
end
to_string(size, key, val) click to toggle source
# File lib/bio/io/flatfile/index.rb, line 710
def self.to_string(size, key, val)
  sprintf("%-*s", size, key + "\t" + val.join("\t"))
end

Public Instance Methods

==(x) click to toggle source
# File lib/bio/io/flatfile/index.rb, line 718
def ==(x)
  self.to_s == x.to_s
end
to_s() click to toggle source
# File lib/bio/io/flatfile/index.rb, line 706
def to_s
  self.class.to_string(@size, @key, @val)
end