module LazyRecord::DynamicModules

Generate dynamic modules for dynamic methods created with define_method, for insertion into inheritance chain. This allows you to make calls to super for these methods.

Public Instance Methods

get_or_set_mod(module_name) click to toggle source
# File lib/lazy_record/dynamic_modules.rb, line 8
def get_or_set_mod(module_name)
  if const_defined?(module_name, _search_ancestors = false)
    const_get(module_name)
  else
    const_set(module_name, Module.new)
  end
end