class Bio::GFF::GFF2::MetaData

Stores GFF2 meta-data.

Attributes

data[RW]

data of this entry

directive[RW]

Directive. Usually, one of “feature-ontology”, “attribute-ontology”, or “source-ontology”.

Public Class Methods

new(directive, data = nil) click to toggle source

Creates a new MetaData object

# File lib/bio/db/gff.rb, line 765
def initialize(directive, data = nil)
  @directive = directive
  @data = data
end
parse(line) click to toggle source

parses a line

# File lib/bio/db/gff.rb, line 778
def self.parse(line)
  directive, data = line.chomp.split(/\s+/, 2)
  directive = directive.sub(/\A\#\#/, '') if directive
  self.new(directive, data)
end

Public Instance Methods

==(other) click to toggle source

Returns true if self == other. Otherwise, returns false.

# File lib/bio/db/gff.rb, line 792
def ==(other)
  if self.class == other.class and
      self.directive == other.directive and
      self.data == other.data then
    true
  else
    false
  end
end
to_s() click to toggle source

string representation of this meta-data

# File lib/bio/db/gff.rb, line 785
def to_s
  d = @directive.to_s.gsub(/[\r\n]+/, ' ')
  v = ' ' + @data.to_s.gsub(/[\r\n]+/, ' ') unless @data.to_s.empty?
  "\#\##{d}#{v}\n"
end