Skip to content

Instantly share code, notes, and snippets.

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