Skip to content

Commit

Permalink
Allow auto_call_delayed_io to be called multiple times .Closes #149
Browse files Browse the repository at this point in the history
  • Loading branch information
dmendel committed Feb 7, 2023
1 parent f2e4c62 commit f60cf9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/bindata/delayed_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ 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
Expand Down

0 comments on commit f60cf9e

Please sign in to comment.