Class: NexusParser::Tokens::ValuePair
- Defined in:
- lib/nexus_parser/tokens.rb
Overview
note we grab EOL and ; here
Instance Attribute Summary
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(str) ⇒ ValuePair
constructor
A new instance of ValuePair.
Constructor Details
#initialize(str) ⇒ ValuePair
Returns a new instance of ValuePair.
104 105 106 107 108 109 110 111 |
# File 'lib/nexus_parser/tokens.rb', line 104 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 |