Class: OboParser::OboParser::Term

Inherits:
Stanza
  • Object
show all
Defined in:
lib/obo_parser.rb

Overview

TODO: likely deprecate and run with one model (Stanza)

Instance Attribute Summary collapse

Attributes inherited from Stanza

#def, #id, #name, #other_tags

Instance Method Summary collapse

Methods inherited from Stanza

#tags_named

Constructor Details

#initialize(tags) ⇒ Term

Returns a new instance of Term.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/obo_parser.rb', line 105

def initialize(tags)
 super
 @relationships = [] 
 anonymous_tags = [] 
 # Loop through "unclaimed" tags and reference those specific to Term
 while @other_tags.size != 0
   t = @other_tags.shift
   case t.tag
  
   when 'relationship'
     @relationships.push([t.relation, t.related_term])
   else
     anonymous_tags.push(t)
   end
 end
 @other_tags = anonymous_tags
end

Instance Attribute Details

#relationshipsObject

Returns the value of attribute relationships.



104
105
106
# File 'lib/obo_parser.rb', line 104

def relationships
  @relationships
end