Class: Obo::Parser
- Inherits:
-
Object
- Object
- Obo::Parser
- Defined in:
- lib/obo_ext/parser.rb
Instance Method Summary collapse
Instance Method Details
#children_of(id) ⇒ Object
14 15 16 |
# File 'lib/obo_ext/parser.rb', line 14 def children_of(id) self.elements.to_a.keep_if { |x| x.is_a?(Obo::Stanza) && (x.parent?(id))} end |
#stanza(id) ⇒ Object
9 10 11 12 |
# File 'lib/obo_ext/parser.rb', line 9 def stanza(id) elements = self.elements.to_a.keep_if { |x| x.is_a?(Obo::Stanza) && (x.id == id)} elements.first if elements.is_a?(Array) end |
#stanzas ⇒ Object
5 6 7 |
# File 'lib/obo_ext/parser.rb', line 5 def stanzas self.elements.to_a.keep_if { |x| x.is_a?(Obo::Stanza)} end |