Class: Module

Inherits:
Object show all
Defined in:
lib/hash-utils/module.rb

Overview

Module extension.

Instance Method Summary collapse

Instance Method Details

#get_module(name) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/hash-utils/module.rb', line 25

def get_module(name)
    names = name.split("::")
    mod = self
    
    while not names.empty?
        name = names.shift
        mod = mod.const_get(name)
    end
    
    return mod
end