Class: AdHocTemplate::RecordReader::IterationReader
- Defined in:
- lib/ad_hoc_template/record_reader.rb
Instance Method Summary collapse
Methods inherited from Reader
#initialize, #pop_stack, setup_reader
Constructor Details
This class inherits a constructor from AdHocTemplate::RecordReader::Reader
Instance Method Details
#read(line) ⇒ Object
259 260 261 262 263 264 265 |
# File 'lib/ad_hoc_template/record_reader.rb', line 259 def read(line) case line when ITERATION_HEAD setup_new_block(line, []) @stack.push_new_record end end |
#setup_stack(line) ⇒ Object
244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/ad_hoc_template/record_reader.rb', line 244 def setup_stack(line) case line when ITERATION_HEAD @stack.pop_current_record when BLOCK_HEAD @stack.pop_current_record pop_stack @stack.push @readers[:block] when SEPARATOR @stack.pop_current_record @stack.last_block_value.push @stack.push_new_record @stack.push @readers[:key_value] end end |