Class: Riddle::Configuration::Parser::InnerParser

Inherits:
Object
  • Object
show all
Defined in:
lib/riddle/configuration/parser.rb

Constant Summary collapse

SETTING_PATTERN =
/^(\w+)\s*=\s*(.*)$/

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ InnerParser

Returns a new instance of InnerParser.



129
130
131
132
# File 'lib/riddle/configuration/parser.rb', line 129

def initialize(input)
  @stream   = StringIO.new(input)
  @sections = {}
end

Instance Method Details

#parse!Object



134
135
136
137
138
139
140
# File 'lib/riddle/configuration/parser.rb', line 134

def parse!
  while label = next_line do
    @sections[label] = next_settings
  end

  @sections
end