Skip to content

Instantly share code, notes, and snippets.

@spacemonkeyvt
Created July 19, 2016 15:59
Show Gist options
  • Save spacemonkeyvt/c82f58ea07854bab68d143cc806e7fe9 to your computer and use it in GitHub Desktop.
Save spacemonkeyvt/c82f58ea07854bab68d143cc806e7fe9 to your computer and use it in GitHub Desktop.
> nest = [1,2,3, {name: "Vish", address: ["123 fake add", "456 fake add", city: ["toronto", "north york"]]}, ["thingy", "thingy2"]]
#=> [1, 2, 3, {:name=>"Vish", :address=>["123 fake add", "456 fake add", {:city=>["toronto", "north york"]}]}, ["thingy", "thingy2"]]
> nest[3]
#=> {:name=>"Vish", :address=>["123 fake add", "456 fake add", {:city=>["toronto", "north york"]}]}
> nest[3][:address]
#=> ["123 fake add", "456 fake add", {:city=>["toronto", "north york"]}]
> nest[3][:address][2]
#=> {:city=>["toronto", "north york"]}
> nest[3][:address][2][:city]
#=> ["toronto", "north york"]
> nest[3][:address][2][:city][0]
#=> "toronto"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment