module Modularize
Constants
- VERSION
Public Class Methods
create(path, root = Object)
click to toggle source
# File lib/modularize/modularize.rb, line 2 def self.create(path, root = Object) path.split('::').each do |name| root = create_module(name, root) end end
Private Class Methods
create_module(name, root)
click to toggle source
# File lib/modularize/modularize.rb, line 10 def self.create_module(name, root) new_module = root.const_defined?(name, false) ? root.const_get(name) : nil unless new_module new_module = Module.new root.const_set name, new_module end new_module end