class OboParser::OboParser::Stanza
A collection of single lines (Tags)
Attributes
def[RW]
Make special reference to several specific types of tags (:name, :id), subclasses will remove additional special typs from :other_tags
id[RW]
Make special reference to several specific types of tags (:name, :id), subclasses will remove additional special typs from :other_tags
name[RW]
Make special reference to several specific types of tags (:name, :id), subclasses will remove additional special typs from :other_tags
Public Class Methods
new(tags)
click to toggle source
# File lib/obo_parser.rb, line 60 def initialize(tags) @other_tags = [] while tags.length != 0 t = tags.shift new_tag = OboParser::Tag.new new_tag.tag = t.tag new_tag.value = t.value new_tag.comment = t.comment new_tag.xrefs = t.xrefs case new_tag.tag when 'id' @id = new_tag when 'name' @name = new_tag when 'def' @def = new_tag else if new_tag.tag == 'relationship' new_tag.related_term = t.related_term new_tag.relation = t.relation end @other_tags.push(new_tag) end end end