Skip to content

Instantly share code, notes, and snippets.

@capotej
Created February 27, 2009 11:43
Show Gist options
  • Save capotej/71424 to your computer and use it in GitHub Desktop.
Save capotej/71424 to your computer and use it in GitHub Desktop.
using symbols as case conditions looks cool
def choose arg
case arg
when :something:
puts "something"
when :other:
puts "other"
default
puts "nothing"
end
end
choose :something #=> "something"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment