Skip to content
Create a gist now

Instantly share code, notes, and snippets.

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) }
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.