Created
February 26, 2014 15:56
-
-
Save breinz/9232305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def all_children(include_self=true) | |
ar = [] | |
add_children ar, self, include_self | |
ar | |
end | |
def add_children(ar, g, save=true) | |
ar << g if save | |
g.children.each{ |c| c.add_children ar, c } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment