lib/bindata/delayed_io.rb in bindata-2.3.5 vs lib/bindata/delayed_io.rb in bindata-2.4.0

- old
+ new

@@ -139,29 +139,23 @@ class DelayedIoArgProcessor < BaseArgProcessor include MultiFieldArgSeparator def sanitize_parameters!(obj_class, params) params.merge!(obj_class.dsl_params) - params.must_be_integer(:read_abs_offset) - - if params.needs_sanitizing?(:type) - el_type, el_params = params[:type] - params[:type] = params.create_sanitized_object_prototype(el_type, el_params) - end + params.sanitize_object_prototype(:type) end end # Add +auto_call_delayed_io+ keyword to BinData::Base. class Base class << self # The +auto_call_delayed_io+ keyword sets a data object tree to perform # multi pass I/O automatically. def auto_call_delayed_io - include AutoCallDelayedIO - return if DelayedIO.method_defined? :initialize_instance_without_record_io + include AutoCallDelayedIO DelayedIO.send(:alias_method, :initialize_instance_without_record_io, :initialize_instance) DelayedIO.send(:define_method, :initialize_instance) do if @parent && !defined? @delayed_io_recorded @delayed_io_recorded = true list = top_level_get(:delayed_ios)