Module: InstDataShipper::DataSources::Base::ModuleHelperMethods

Defined in:
lib/inst_data_shipper/data_sources/base.rb

Instance Method Summary collapse

Instance Method Details

#delayed(mthd_sym) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/inst_data_shipper/data_sources/base.rb', line 17

def delayed(mthd_sym)
  mthd = instance_method(mthd_sym)
  pmthd_sym = :"_delayed_#{mthd_sym}"

  alias_method pmthd_sym, mthd_sym
  private pmthd_sym

  define_method(mthd_sym) do |*args, **kwargs|
    delayed(pmthd_sym, *args, **kwargs)
  end
end