Class: BinData::ArrayArgProcessor

Inherits:
BaseArgProcessor show all
Defined in:
lib/bindata/array.rb

Instance Method Summary collapse

Methods inherited from BaseArgProcessor

#extract_args, #separate_args

Instance Method Details

#sanitize_parameters!(obj_class, params) ⇒ Object

:nodoc:



330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/bindata/array.rb', line 330

def sanitize_parameters!(obj_class, params) # :nodoc:
  # ensure one of :initial_length and :read_until exists
  unless params.has_at_least_one_of?(:initial_length, :read_until)
    params[:initial_length] = 0
  end

  params.warn_replacement_parameter(:length, :initial_length)
  params.warn_replacement_parameter(:read_length, :initial_length)
  params.must_be_integer(:initial_length)

  params.merge!(obj_class.dsl_params)
  params.sanitize_object_prototype(:type)
end