Class Bio::GFF::GFF2::MetaData
In: lib/bio/db/gff.rb
Parent: Object

Stores GFF2 meta-data.

Methods

==   new   parse   to_s  

Attributes

data  [RW]  data of this entry
directive  [RW]  Directive. Usually, one of "feature-ontology", "attribute-ontology", or "source-ontology".

Public Class methods

Creates a new MetaData object

[Source]

     # File lib/bio/db/gff.rb, line 766
766:         def initialize(directive, data = nil)
767:           @directive = directive
768:           @data = data
769:         end

parses a line

[Source]

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

Public Instance methods

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

[Source]

     # File lib/bio/db/gff.rb, line 793
793:         def ==(other)
794:           if self.class == other.class and
795:               self.directive == other.directive and
796:               self.data == other.data then
797:             true
798:           else
799:             false
800:           end
801:         end

string representation of this meta-data

[Source]

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

[Validate]