Skip to content

Instantly share code, notes, and snippets.

@AnkurVyas-BTC
Created July 24, 2016 08:05
Show Gist options
  • Save AnkurVyas-BTC/df54acedf79ede45e7da2298fd9f83fe to your computer and use it in GitHub Desktop.
Save AnkurVyas-BTC/df54acedf79ede45e7da2298fd9f83fe to your computer and use it in GitHub Desktop.
How to write simple case statement ruby
case
when input = '+'
puts 'The operation is addition'
when '-'
puts 'The operation is subtraction'
when '*'
puts 'The operation is multiplication'
else
puts 'The operation is division'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment