Class | Bio::FlatFileIndex::Flat_1::Record
In: | lib/bio/io/flatfile/index.rb
Parent: | Object

Record class.

Internal use only.

### Methods

== create new to_s to_string

### Attributes

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

### Public Class methods

create(size, key, val)

[Source]

         # File lib/bio/io/flatfile/index.rb, line 714
    714:         def self.create(size, key, val)
    715:           self.new(self.to_string(size, key, val))
    716:         end

new(str, size = nil)

[Source]

         # File lib/bio/io/flatfile/index.rb, line 696
    696:         def initialize(str, size = nil)
    697:           a = str.split("\t")
    698:           a.each { |x| x.to_s.gsub!(/[\000 ]+\z/, '') }
    699:           @key = a.shift.to_s
    700:           @val = a
    701:           @size = (size or str.length)
    702:           #DEBUG.print "key=#{@key.inspect},val=#{@val.inspect},size=#{@size}\n"
    703:         end

to_string(size, key, val)

[Source]

         # File lib/bio/io/flatfile/index.rb, line 710
    710:         def self.to_string(size, key, val)
    711:           sprintf("%-*s", size, key + "\t" + val.join("\t"))
    712:         end

### Public Instance methods

==(x)

[Source]

         # File lib/bio/io/flatfile/index.rb, line 718
    718:         def ==(x)
    719:           self.to_s == x.to_s
    720:         end

to_s()

[Source]

         # File lib/bio/io/flatfile/index.rb, line 706
    706:         def to_s
    707:           self.class.to_string(@size, @key, @val)
    708:         end

[Validate]