Module: BinData::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



302
303
304
305
306
307
308
309
# File 'lib/bindata/array.rb', line 302

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