Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Gist #5 For "Functional Programming Techniques With Ruby: Part I"
def module_split(module_path, separator = "::")
modules = module_path.split(separator)
modules.length.downto(1).map { |n| modules.first(n).join(separator) }
end
module_split("W::X::Y::Z")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.