Skip to content

Instantly share code, notes, and snippets.

@ninjs
Created April 21, 2015 18:42
Show Gist options
  • Save ninjs/0f2bf982b18735d700a8 to your computer and use it in GitHub Desktop.
Save ninjs/0f2bf982b18735d700a8 to your computer and use it in GitHub Desktop.
insurance_hash = {'Select Health' => 'Select'}
insurance_array = ["Select Health", "Select Health New York", "Select Health Colorado"]
insurance_hash.fetch(insurance_array[3], "unknown")
#I want it to return "Select", not unknown, without specifically adding it to the hash..
# (to check for anything that ever says 'Select Health' in the name, and always return that 'Select')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment