Skip to content

Instantly share code, notes, and snippets.

@rpearce
Last active August 27, 2015 02:36
Show Gist options
  • Save rpearce/e6455f67ecfddadee780 to your computer and use it in GitHub Desktop.
Save rpearce/e6455f67ecfddadee780 to your computer and use it in GitHub Desktop.
Songs Map Challenge
songs = [
{
id: 1,
title: "Mother",
author: "Pink Floyd",
album: "The Wall"
},
{
id: 2,
title: "Since I've been Loving You",
author: "Led Zeppelin",
album: "Led Zeppelin III"
},
{
id: 3,
title: "Re: Stacks",
author: "Bon Iver",
album: "For Emma, Forever Ago"
},
{
id: 4,
title: "Von",
author: "Sigur Rós",
album: "Hvarf-Heim"
}
]
# Write code that will use the `songs` hash
# and return an array of hashes containing
# only `id` and `title`.
# The return value should be this:
# [{ id: 1, title: "Mother" }, { id: 2, title: "Since I've been Loving You" }, { id: 3, title: "Re: Stacks" }, { id: 4, title: "Von" }]
#
# your code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment