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
768 def initialize(directive, data = nil)
769   @directive = directive
770   @data = data
771 end
parse(line) click to toggle source

parses a line

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

Public Instance Methods

==(other) click to toggle source

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

    # File lib/bio/db/gff.rb
795 def ==(other)
796   if self.class == other.class and
797       self.directive == other.directive and
798       self.data == other.data then
799     true
800   else
801     false
802   end
803 end
to_s() click to toggle source

string representation of this meta-data

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