Class: OboParser::Tokens::ValuePair

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

Overview

note we grab EOL and ; here

Instance Attribute Summary

Attributes inherited from Token

#value

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ ValuePair

Returns a new instance of ValuePair.



201
202
203
204
205
206
207
208
# File 'lib/tokens.rb', line 201

def initialize(str)
  str.strip!
  str = str.split(/=/)
  str[1].strip!
  str[1] = str[1][1..-2] if str[1][0..0] == "'" 
  str[1] = str[1][1..-2] if str[1][0..0] ==  "\"" 
  @value = {str[0].strip.downcase.to_sym => str[1].strip}
end