Skip to content

Instantly share code, notes, and snippets.

@carlzulauf
Created January 22, 2012 06:07
Show Gist options
  • Save carlzulauf/1655860 to your computer and use it in GitHub Desktop.
Save carlzulauf/1655860 to your computer and use it in GitHub Desktop.
searching by second element in an array of arrays
ruby-1.9.2-p290 :073 > Sample::LANGUAGES.select{|e| e[1] == "text/html"}.any?
=> true
ruby-1.9.2-p290 :074 > Sample::LANGUAGES.select{|e| e[1] == "text/htmld"}.any?
=> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment