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 765
765:         def initialize(directive, data = nil)
766:           @directive = directive
767:           @data = data
768:         end

parses a line

[Source]

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

Public Instance methods

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

[Source]

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

string representation of this meta-data

[Source]

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

[Validate]