Skip to content

Instantly share code, notes, and snippets.

@joshcrews
Created October 16, 2012 19:00
Show Gist options
  • Save joshcrews/3901250 to your computer and use it in GitHub Desktop.
Save joshcrews/3901250 to your computer and use it in GitHub Desktop.
def find_shoes(temp, precipitation)
shoe_combos = [
{:temp => 90, :precipitation => false, :shoes => 'Sandals'},
{:temp => 90, :precipitation => true, :shoes => 'Flip-Flops'}
]
right_answers = shoe_combos.select do |combo|
combo[:temp] == temp && combo[:precipitation] = precipitation)
end
right_answers.first[:shoes]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment