Sha256: ddc7e821be6f51ddd45a566584af363b0ba3bf266558cf0481dd0a15d7d07662
Contents?: true
Size: 279 Bytes
Versions: 10
Compression:
Stored size: 279 Bytes
Contents
class Module # Show a modules nesting in module namespaces. # # A::B::C.nesting #=> [ A, A::B ] # # CREDIT: Trans def nesting n = [] name.split(/::/).inject(self) do |mod, name| c = mod.const_get(name) ; n << c ; c end return n end end
Version data entries
10 entries across 10 versions & 1 rubygems