Module: BinData::Array::ReadUntilPlugin

Defined in:
lib/bindata/array.rb

Overview

Logic for the :read_until parameter

Instance Method Summary collapse

Instance Method Details

#do_read(io) ⇒ Object



285
286
287
288
289
290
291
292
# File 'lib/bindata/array.rb', line 285

def do_read(io)
  loop do
    element = append_new_element
    element.do_read(io)
    variables = { index: self.length - 1, element: self.last, array: self }
    break if eval_parameter(:read_until, variables)
  end
end