Last active
August 29, 2015 14:19
-
-
Save tommyp/ce94b84bb807c98be057 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
[ | |
{title: "this is a title", link: "this-is-a-link"}, | |
{title: "parent title", link: "parent-title"}, | |
{title: "second parent title", link: "second-parent-title"} | |
] | |
# or | |
[ | |
OpenStruct.new(title: "this is a title", link: "this-is-a-link"), | |
OpenStruct.new(title: "parent title", link: "parent-title"), | |
OpenStruct.new(title: "second parent title", link: "second-parent-title") | |
] | |
# But sometimes this will also be nil! | |
# to | |
{ | |
title: "this is a title", | |
link: "this-is-a-link", | |
parent: { | |
title: "parent title", | |
link: "parent-title", | |
parent: { | |
title: "second parent title", | |
link: "second-parent-title" | |
} | |
}, | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment