Class: Mspire::OBO
- Inherits:
-
Object
- Object
- Mspire::OBO
- Defined in:
- lib/mspire/obo.rb
Instance Attribute Summary (collapse)
-
- (Object) elements
Returns the value of attribute elements.
-
- (Object) header
Returns the value of attribute header.
Instance Method Summary (collapse)
- - (Object) id_to_element
-
- (Object) id_to_name
returns an id to name Hash.
-
- (OBO) initialize(file_or_io)
constructor
A new instance of OBO.
-
- (Object) name_to_id
returns a name to id Hash.
Constructor Details
- (OBO) initialize(file_or_io)
A new instance of OBO
7 8 9 10 11 |
# File 'lib/mspire/obo.rb', line 7 def initialize(file_or_io) obo = Obo::Parser.new(file_or_io) elements = obo.elements.to_a header = elements.shift end |
Instance Attribute Details
- (Object) elements
Returns the value of attribute elements
5 6 7 |
# File 'lib/mspire/obo.rb', line 5 def elements @elements end |
- (Object) header
Returns the value of attribute header
4 5 6 |
# File 'lib/mspire/obo.rb', line 4 def header @header end |
Instance Method Details
- (Object) id_to_element
20 21 22 |
# File 'lib/mspire/obo.rb', line 20 def id_to_element @id_to_element ||= build_hash('id', nil) end |
- (Object) id_to_name
returns an id to name Hash
13 14 15 |
# File 'lib/mspire/obo.rb', line 13 def id_to_name @id_to_name ||= build_hash('id', 'name') end |
- (Object) name_to_id
returns a name to id Hash
17 18 19 |
# File 'lib/mspire/obo.rb', line 17 def name_to_id @name_to_id ||= build_hash('name', 'id') end |