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



297
298
299
300
301
302
303
304
305
# File 'lib/bindata/array.rb', line 297

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