Created
September 22, 2012 16:26
-
-
Save Hamcha/3766666 to your computer and use it in GitHub Desktop.
Paradise reordering
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
$paradise = { YOUR MEGA WORLD THING HERE } | |
$paradise.each do |p| | |
parent = p[1]["parent"] | |
if $paradise.has_key?(parent) | |
unless $paradise[parent].has_key?("childs") | |
$paradise[parent]["childs"] = Array.new | |
end | |
$paradise[parent]["childs"].push(p) | |
$paradise.delete(p) | |
end | |
end | |
print $paradise.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
html = ""
vessel = Hash.new