Skip to content

Instantly share code, notes, and snippets.

@elikem
Created March 4, 2014 00:14
Show Gist options
  • Select an option

  • Save elikem/9337546 to your computer and use it in GitHub Desktop.

Select an option

Save elikem/9337546 to your computer and use it in GitHub Desktop.
good resources on hashes
people = {
:fred => { :name => "Fred", :age => 23 },
:joan => { :name => "Joan", :age => 18 },
:pete => { :name => "Pete", :age => 54 }
}
people.sort_by { |k, v|
v[:age]
}
# http://www.gethourglass.com/blog/ruby-how-to-sort-a-hash.html
# http://www.rubyinside.com/how-to/ruby-sort-hash
# http://www.tutorialspoint.com/ruby/ruby_hashes.htm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment