module InstDataShipper module DataSources module Base # This could be a Concern, but we don't want Concern inheritance logic kicking in if it is included into another Concern. def self.included(base) base.extend ActiveSupport::Concern unless self.is_a?(Class) || base < ActiveSupport::Concern base.extend ModuleHelperMethods base.send(:include, Concern) end module Concern extend ActiveSupport::Concern end module ModuleHelperMethods 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 end end end end