class EacRubyUtils::CommonConcern::ModuleSetup
def a_module_method_args(module_method)
def a_module_method_args(module_method) method_arity = a_module.method(module_method).arity method_arity = -method_arity - 1 if method_arity.negative? method_arity.times.map { |_n| a_module } end
def include_or_prepend(module_method, class_setup_method)
def include_or_prepend(module_method, class_setup_method) setup = self a_module.send(module_method, *a_module_method_args(module_method)) do ::EacRubyUtils::CommonConcern::ClassSetup.new(setup, self, class_setup_method).run end end
def initialize(common_concern, a_module)
def initialize(common_concern, a_module) @common_concern = common_concern @a_module = a_module end
def run
def run a_module.extend(::ActiveSupport::Concern) include_or_prepend(:included, :include) include_or_prepend(:prepended, :prepend) end