Class: Module

Inherits:
Object show all
Defined in:
lib/console_with_helpers.rb

Instance Method Summary collapse

Instance Method Details

#include_all_modules_from(parent_module) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/console_with_helpers.rb', line 2

def include_all_modules_from(parent_module)
  parent_module.constants.each do |const|
    mod = parent_module.const_get(const)
    if mod.class == Module
      send(:include, mod)
      include_all_modules_from(mod)
    end
  end
end