Skip to content

Instantly share code, notes, and snippets.

@rodloboz
Created October 19, 2018 16:52
Show Gist options
  • Save rodloboz/9088decfe32fe7ea3a6a49664beb1014 to your computer and use it in GitHub Desktop.
Save rodloboz/9088decfe32fe7ea3a6a49664beb1014 to your computer and use it in GitHub Desktop.
#. 0. 1
students = [
["john", 28],
["mary", 22],
["peter", 18]
]
# TODO: transform student into an array of hashes
students_hash = students.map do |student|
{
name: student[0],
age: student[1]
}
end
p students
p students_hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment