Class: Obo::Header

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHeader

Returns a new instance of Header.



8
9
10
# File 'lib/obo.rb', line 8

def initialize
  @tagvalues = Hash.new{|h,k| h[k] = []}
end

Instance Attribute Details

#tagvaluesObject (readonly)

Returns the value of attribute tagvalues.



6
7
8
# File 'lib/obo.rb', line 6

def tagvalues
  @tagvalues
end

Instance Method Details

#[](tag) ⇒ Object



12
13
14
15
# File 'lib/obo.rb', line 12

def [](tag)
  values = @tagvalues[tag]
  values.length == 1 ? values.first : values
end

#add(tag, value) ⇒ Object



17
18
19
# File 'lib/obo.rb', line 17

def add(tag,value)
  @tagvalues[tag] << value
end