Class: OboParser::Tokens::TagValuePair

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ TagValuePair

Returns a new instance of TagValuePair.



27
28
29
30
31
32
33
34
35
36
# File 'lib/tokens.rb', line 27

def initialize(str)
  str.strip!
  str = str.split(':',2)      
  
  str[1].strip!
  # strip trailing comments

  @tag = str[0]
  @value = str[1]
end

Instance Attribute Details

#tagObject (readonly)

Returns the value of attribute tag.



25
26
27
# File 'lib/tokens.rb', line 25

def tag
  @tag
end

#valueObject (readonly)

Returns the value of attribute value.



25
26
27
# File 'lib/tokens.rb', line 25

def value
  @value
end