Module: BinData::Array::InitialLengthPlugin
- Defined in:
- lib/bindata/array.rb
Overview
Logic for the :initial_length parameter
Instance Method Summary collapse
Instance Method Details
#do_read(io) ⇒ Object
312 313 314 |
# File 'lib/bindata/array.rb', line 312 def do_read(io) elements.each { |el| el.do_read(io) } end |
#elements ⇒ Object
316 317 318 319 320 321 322 323 324 325 |
# File 'lib/bindata/array.rb', line 316 def elements if @elements.nil? @elements = [] eval_parameter(:initial_length).times do @elements << new_element end end @elements end |