module Concurrent::Dereferenceable

def set_deref_options(opts = {})

Options Hash: (**opts)
  • :copy_on_deref (String) -- call the given +Proc+ passing the internal value and
  • :freeze_on_deref (String) -- call +#freeze+ before returning the data
  • :dup_on_deref (String) -- call +#dup+ before returning the data

Parameters:
  • opts (Hash) -- the options defining dereference behavior.

Other tags:
    Note: - Most classes that include this module will call +#set_deref_options+
def set_deref_options(opts = {})
  mutex.synchronize do
    @dup_on_deref = opts[:dup_on_deref] || opts[:dup]
    @freeze_on_deref = opts[:freeze_on_deref] || opts[:freeze]
    @copy_on_deref = opts[:copy_on_deref] || opts[:copy]
    @do_nothing_on_deref = ! (@dup_on_deref || @freeze_on_deref || @copy_on_deref)
  end
end