Class: Obo::Ontology
- Inherits:
-
Object
- Object
- Obo::Ontology
- Defined in:
- lib/obo/ontology.rb
Constant Summary collapse
- DIR =
File.(File.dirname(__FILE__) + '/../../obo')
Instance Attribute Summary collapse
-
#elements ⇒ Object
Returns the value of attribute elements.
-
#header ⇒ Object
Returns the value of attribute header.
Instance Method Summary collapse
- #id_to_element ⇒ Object
-
#id_to_name ⇒ Object
returns an id to name Hash.
-
#initialize(file_or_io) ⇒ Ontology
constructor
A new instance of Ontology.
-
#name_to_id ⇒ Object
returns a name to id Hash.
Constructor Details
Instance Attribute Details
#elements ⇒ Object
Returns the value of attribute elements.
7 8 9 |
# File 'lib/obo/ontology.rb', line 7 def elements @elements end |
#header ⇒ Object
Returns the value of attribute header.
6 7 8 |
# File 'lib/obo/ontology.rb', line 6 def header @header end |
Instance Method Details
#id_to_element ⇒ Object
23 24 25 |
# File 'lib/obo/ontology.rb', line 23 def id_to_element @id_to_element ||= build_hash('id', nil) end |
#id_to_name ⇒ Object
returns an id to name Hash
16 17 18 |
# File 'lib/obo/ontology.rb', line 16 def id_to_name @id_to_name ||= build_hash('id', 'name') end |
#name_to_id ⇒ Object
returns a name to id Hash
20 21 22 |
# File 'lib/obo/ontology.rb', line 20 def name_to_id @name_to_id ||= build_hash('name', 'id') end |